diff Lib/test/support.py @ 66706:ae3fa781eef2

Issue #10624: Move requires_IEEE_754 into test.support. I'll fix up other uses of it shortly.
author Eric Smith <eric@trueblade.com>
date Sat, 04 Dec 2010 13:32:18 +0000
parents 9a2058309c1a
children 779a23a08d8c
line wrap: on
line diff
--- a/Lib/test/support.py	Sat Dec 04 13:27:34 2010 +0000
+++ b/Lib/test/support.py	Sat Dec 04 13:32:18 2010 +0000
@@ -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