Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] double_abs test failures #6528

Open
Apteryks opened this issue Nov 30, 2024 · 1 comment
Open

[BUG] double_abs test failures #6528

Apteryks opened this issue Nov 30, 2024 · 1 comment
Labels

Comments

@Apteryks
Copy link

Apteryks commented Nov 30, 2024

Describe the bug

Running the test suite of Cython 3.0.11 with GNU Guix, I see the following doctests failures:

======================================================================
FAIL: double_abs (complex_numbers_cpp)
Doctest: complex_numbers_cpp.double_abs
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/gnu/store/lp8ch4rn10whzyajnzv216d2a2v163c7-python-3.10.7/lib/python3.10/doctest.py", line 2221, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for complex_numbers_cpp.double_abs
  File "/tmp/guix-build-python-cython-3.0.11.drv-0/cython-3.0.11/TEST_TMP/14/run/cpp/complex_numbers_cpp/complex_numbers_cpp.cpython-310-x86_64-linux-gnu.so", line unknown line number, in double_abs

----------------------------------------------------------------------
File "/tmp/guix-build-python-cython-3.0.11.drv-0/cython-3.0.11/TEST_TMP/14/run/cpp/complex_numbers_cpp/complex_numbers_cpp.cpython-310-x86_64-linux-gnu.so", line ?, in complex_numbers_cpp.double_abs
Failed example:
    double_abs(2 + 5j) == math.sqrt(29)
Expected:
    True
Got:
    False


======================================================================
FAIL: double_abs (complex_numbers_cpp)
Doctest: complex_numbers_cpp.double_abs
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/gnu/store/lp8ch4rn10whzyajnzv216d2a2v163c7-python-3.10.7/lib/python3.10/doctest.py", line 2221, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for complex_numbers_cpp.double_abs
  File "/tmp/guix-build-python-cython-3.0.11.drv-0/cython-3.0.11/TEST_TMP/14/run/cpp/complex_numbers_cpp_directives_cpp_locals_True/complex_numbers_cpp.cpython-310-x86_64-linux-gnu.so", line unknown line number, in double_abs

----------------------------------------------------------------------
File "/tmp/guix-build-python-cython-3.0.11.drv-0/cython-3.0.11/TEST_TMP/14/run/cpp/complex_numbers_cpp_directives_cpp_locals_True/complex_numbers_cpp.cpython-310-x86_64-linux-gnu.so", line ?, in complex_numbers_cpp.double_abs
Failed example:
    double_abs(2 + 5j) == math.sqrt(29)
Expected:
    True
Got:
    False


----------------------------------------------------------------------
Ran 579 tests in 86.348s

FAILED (failures=2)

The only direct dependencies added to the build environment are:
[email protected] [email protected]. GCC is at version 11.4.0.

Code to reproduce the behaviour:

Just building it with a similar environment should trigger it.

Expected behaviour

All tests should pass.

OS

GNU+Linux

Python version

3.10.7

Cython version

3.0.11

Additional context

Initially misfiled here: python/cpython#127437.

@Apteryks Apteryks changed the title [BUG] [BUG] double_abs test failures Nov 30, 2024
@da-woods
Copy link
Contributor

Thanks for the report.

This probably just needs to be rewritten to check for a small difference rather than an exact equals. So I suspect this test failure isn't anything to really worry about. But we should fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants