Skip to content

Commit c39b3c7

Browse files
committed
pythongh-130317: Skip test_pack_unpack_roundtrip_for_nans() on x86
Reduce also the number of iterations from 1000 to 10 to ease debugging failures and prevent "command line too line" error when tests are re-run.
1 parent 5ea9010 commit c39b3c7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Lib/test/test_capi/test_float.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,17 @@ def test_pack_unpack_roundtrip(self):
180180
self.assertEqual(value2, value)
181181

182182
@unittest.skipUnless(HAVE_IEEE_754, "requires IEEE 754")
183+
# Skip on x86 (32-bit), since these tests fail. The problem is that sNaN
184+
# doubles become qNaN doubles just by the C calling convention, there is no
185+
# way to preserve sNaN doubles between C function calls. But tests pass
186+
# on Windows x86.
187+
@unittest.skipIf((sys.maxsize == 2147483647) and not(sys.platform == 'win32'),
188+
'test fails on x86 (32-bit)')
183189
def test_pack_unpack_roundtrip_for_nans(self):
184190
pack = _testcapi.float_pack
185191
unpack = _testcapi.float_unpack
186-
for _ in range(1000):
192+
193+
for _ in range(10):
187194
for size in (2, 4, 8):
188195
sign = random.randint(0, 1)
189196
signaling = random.randint(0, 1)
@@ -203,7 +210,7 @@ def test_pack_unpack_roundtrip_for_nans(self):
203210
data1 = data if endian == BIG_ENDIAN else data[::-1]
204211
value = unpack(data1, endian)
205212
if signaling and sys.platform == 'win32':
206-
# On this platform sNaN becomes qNaN when returned
213+
# On Windows x86, sNaN becomes qNaN when returned
207214
# from function. That's a known bug, e.g.
208215
# https://developercommunity.visualstudio.com/t/155064
209216
# (see also gh-130317).

0 commit comments

Comments
 (0)