[Python-checkins] r87040 - in python/branches/py3k/Lib/test: support.py test_math.py

eric.smith python-checkins at python.org
Sat Dec 4 14:32:18 CET 2010


Author: eric.smith
Date: Sat Dec  4 14:32:18 2010
New Revision: 87040

Log:
Issue #10624: Move requires_IEEE_754 into test.support. I'll fix up other uses of it shortly.

Modified:
   python/branches/py3k/Lib/test/support.py
   python/branches/py3k/Lib/test/test_math.py

Modified: python/branches/py3k/Lib/test/support.py
==============================================================================
--- python/branches/py3k/Lib/test/support.py	(original)
+++ python/branches/py3k/Lib/test/support.py	Sat Dec  4 14:32:18 2010
@@ -366,6 +366,11 @@
         return (len(x) > len(y)) - (len(x) < len(y))
     return (x > y) - (x < y)
 
+# decorator for skipping tests on non-IEEE 754 platforms
+requires_IEEE_754 = unittest.skipUnless(
+    float.__getformat__("double").startswith("IEEE"),
+    "test requires IEEE 754 doubles")
+
 is_jython = sys.platform.startswith('java')
 
 # Filename used for testing

Modified: python/branches/py3k/Lib/test/test_math.py
==============================================================================
--- python/branches/py3k/Lib/test/test_math.py	(original)
+++ python/branches/py3k/Lib/test/test_math.py	Sat Dec  4 14:32:18 2010
@@ -1,7 +1,7 @@
 # Python test set -- math module
 # XXXX Should not do tests around zero only
 
-from test.support import run_unittest, verbose
+from test.support import run_unittest, verbose, requires_IEEE_754
 import unittest
 import math
 import os
@@ -15,11 +15,6 @@
 INF = float('inf')
 NINF = float('-inf')
 
-# decorator for skipping tests on non-IEEE 754 platforms
-requires_IEEE_754 = unittest.skipUnless(
-    float.__getformat__("double").startswith("IEEE"),
-    "test requires IEEE 754 doubles")
-
 # detect evidence of double-rounding: fsum is not always correctly
 # rounded on machines that suffer from double rounding.
 x, y = 1e16, 2.9999 # use temporary values to defeat peephole optimizer


More information about the Python-checkins mailing list