Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_long.py @ 66709:f2a4ade36a1e
Issue #10624: Use support.requires_IEEE_754 in all appropriate tests.
| author | Eric Smith <eric@trueblade.com> |
|---|---|
| date | Sat, 04 Dec 2010 15:17:38 +0000 |
| parents | 8b02f7f9475b |
| children | 3c9232a684ae |
line wrap: on
line diff
--- a/Lib/test/test_long.py Sat Dec 04 13:49:32 2010 +0000 +++ b/Lib/test/test_long.py Sat Dec 04 15:17:38 2010 +0000 @@ -1,5 +1,6 @@ import unittest from test import support + import sys import random @@ -15,11 +16,6 @@ def __str__(self): return self.format % self.args -# decorator for skipping tests on non-IEEE 754 platforms -requires_IEEE_754 = unittest.skipUnless( - float.__getformat__("double").startswith("IEEE"), - "test requires IEEE 754 doubles") - # SHIFT should match the value in longintrepr.h for best testing. SHIFT = sys.int_info.bits_per_digit BASE = 2 ** SHIFT @@ -371,8 +367,7 @@ return 1729 self.assertEqual(int(LongTrunc()), 1729) - @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), - "test requires IEEE 754 doubles") + @support.requires_IEEE_754 def test_float_conversion(self): exact_values = [0, 1, 2, @@ -703,7 +698,7 @@ self.assertEqual(expected, got, "Incorrectly rounded division {}/{}: " "expected {}, got {}".format(a, b, expected, got)) - @requires_IEEE_754 + @support.requires_IEEE_754 def test_correctly_rounded_true_division(self): # more stringent tests than those above, checking that the # result of true division of ints is always correctly rounded.
