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

test_math fails on Windows #126252

Open
Eclips4 opened this issue Oct 31, 2024 · 4 comments
Open

test_math fails on Windows #126252

Eclips4 opened this issue Oct 31, 2024 · 4 comments
Labels
OS-windows stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented Oct 31, 2024

Bug report

Bug description:

./python -m test -v test_math
======================================================================
ERROR: test_fma_overflow (test.test_math.FMATests.test_fma_overflow)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\eclips4\programming\cpython\Lib\test\test_math.py", line 2801, in test_fma_overflow
    self.assertEqual(math.fma(a, b, -c),
                     ~~~~~~~~^^^^^^^^^^
OverflowError: overflow in fma

======================================================================
FAIL: test_fma_zero_result (test.test_math.FMATests.test_fma_zero_result)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\eclips4\programming\cpython\Lib\test\test_math.py", line 2760, in test_fma_zero_result
    self.assertIsNegativeZero(math.fma(tiny, -tiny, 0.0))
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\eclips4\programming\cpython\Lib\test\test_math.py", line 2876, in assertIsNegativeZero
    self.assertTrue(
    ~~~~~~~~~~~~~~~^
        value == 0 and math.copysign(1, value) < 0,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        msg="Expected a negative zero, got {!r}".format(value)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: False is not true : Expected a negative zero, got 0.0

======================================================================
FAIL: test_random (test.test_math.FMATests.test_random)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\eclips4\programming\cpython\Lib\test\test_math.py", line 2859, in test_random
    self.assertEqual(math.fma(a, b, c), expected)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0.5506672157701096 != 0.5506672157701097

----------------------------------------------------------------------
Ran 87 tests in 14.275s

FAILED (failures=2, errors=1, skipped=2)
test test_math failed
test_math failed (1 error, 2 failures)

== Tests result: FAILURE ==

1 test failed:
    test_math

Total duration: 16.3 sec
Total tests: run=87 failures=2 skipped=2
Total test files: run=1/1 failed=1
Result: FAILURE

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

@Eclips4 Eclips4 added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir OS-windows labels Oct 31, 2024
@terryjreedy
Copy link
Member

For me, on current Windows 10, with fresh "Python 3.14.0a1+ experimental free-threading build (heads/main-dirty:0e8665554b2, Oct 31 2024, 14:58:59) [MSC v.1941 64 bit (AMD64)] on win32", 87 tests pass in 10 sec. With installed python.org "Python 3.14.0a1 (tags/v3.14.0a1:8cdaca8, Oct 15 2024, 20:08:21)", ditto, in 1 sec.

@terryjreedy terryjreedy added the stdlib Python modules in the Lib dir label Oct 31, 2024
@eendebakpt
Copy link
Contributor

eendebakpt commented Oct 31, 2024

Tested with main (commit dd3c0fa, Python 3.14.0a1+ (heads/main:dd3c0fa3fd2, Oct 31 2024, 21:48:53) [MSC v.1939 64 bit (AMD64)] on win32) and a normal Windows build, but I cannot reproduce this one either.

@tim-one
Copy link
Member

tim-one commented Oct 31, 2024

Please show the first line displayed when you open an interactive shell. For example, with the released Python 3.13,.0 on 64-bit Windows from python.org:

$ python
Python 3.13.0 (tags/v3.13.0:60403a5, Oct  7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32

@Eclips4
Copy link
Member Author

Eclips4 commented Nov 1, 2024

Please show the first line displayed when you open an interactive shell. For example, with the released Python 3.13,.0 on 64-bit Windows from python.org:

$ python
Python 3.13.0 (tags/v3.13.0:60403a5, Oct  7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32
Python 3.14.0a1+ (heads/main:0e8665554b2, Oct 31 2024, 18:03:04) [MSC v.1941 64 bit (AMD64)] on win32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants