Skip to content

gh-130317: Skip test_pack_unpack_roundtrip_for_nans() on x86 #133155

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

Merged
merged 1 commit into from
Apr 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Lib/test/test_capi/test_float.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,17 @@ def test_pack_unpack_roundtrip(self):
self.assertEqual(value2, value)

@unittest.skipUnless(HAVE_IEEE_754, "requires IEEE 754")
# Skip on x86 (32-bit), since these tests fail. The problem is that sNaN
# doubles become qNaN doubles just by the C calling convention, there is no
# way to preserve sNaN doubles between C function calls. But tests pass
# on Windows x86.
@unittest.skipIf((sys.maxsize == 2147483647) and not(sys.platform == 'win32'),
'test fails on x86 (32-bit)')
def test_pack_unpack_roundtrip_for_nans(self):
pack = _testcapi.float_pack
unpack = _testcapi.float_unpack
for _ in range(1000):

for _ in range(10):
for size in (2, 4, 8):
sign = random.randint(0, 1)
signaling = random.randint(0, 1)
Expand All @@ -203,7 +210,7 @@ def test_pack_unpack_roundtrip_for_nans(self):
data1 = data if endian == BIG_ENDIAN else data[::-1]
value = unpack(data1, endian)
if signaling and sys.platform == 'win32':
# On this platform sNaN becomes qNaN when returned
# On Windows x86, sNaN becomes qNaN when returned
# from function. That's a known bug, e.g.
# https://developercommunity.visualstudio.com/t/155064
# (see also gh-130317).
Expand Down
Loading