summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_long.py
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2010-12-04 15:17:38 (GMT)
committerEric Smith <eric@trueblade.com>2010-12-04 15:17:38 (GMT)
commit3ab08cadaebd694533edee03ad2b4eba2055d4e3 (patch)
tree800efe09ec68445facc140614c7c7420a51c80a4 /Lib/test/test_long.py
parent932e49e3946901f3e2d05f25e407b6be84dac161 (diff)
downloadcpython-3ab08cadaebd694533edee03ad2b4eba2055d4e3.zip
cpython-3ab08cadaebd694533edee03ad2b4eba2055d4e3.tar.gz
cpython-3ab08cadaebd694533edee03ad2b4eba2055d4e3.tar.bz2
Issue #10624: Use support.requires_IEEE_754 in all appropriate tests.
Diffstat (limited to 'Lib/test/test_long.py')
-rw-r--r--Lib/test/test_long.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index 12197ee..04066ec 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -1,5 +1,6 @@
import unittest
from test import support
+
import sys
import random
@@ -15,11 +16,6 @@ class Frm(object):
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 @@ class LongTest(unittest.TestCase):
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 @@ class LongTest(unittest.TestCase):
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.