[Python-checkins] r78099 - python/trunk/Lib/test/test_strtod.py

mark.dickinson python-checkins at python.org
Sun Feb 7 21:31:10 CET 2010


Author: mark.dickinson
Date: Sun Feb  7 21:31:10 2010
New Revision: 78099

Log:
Skip test_strtod entirely when correctly-rounded string->float isn't implemented

Modified:
   python/trunk/Lib/test/test_strtod.py

Modified: python/trunk/Lib/test/test_strtod.py
==============================================================================
--- python/trunk/Lib/test/test_strtod.py	(original)
+++ python/trunk/Lib/test/test_strtod.py	Sun Feb  7 21:31:10 2010
@@ -8,6 +8,10 @@
 import sys
 from test import test_support
 
+if getattr(sys, 'float_repr_style', '') != 'short':
+    raise unittest.SkipTest('correctly-rounded string->float conversions '
+                            'not available on this system')
+
 # Correctly rounded str -> float in pure Python, for comparison.
 
 strtod_parser = re.compile(r"""    # A numeric string consists of:
@@ -78,8 +82,6 @@
 
 TEST_SIZE = 16
 
- at unittest.skipUnless(getattr(sys, 'float_repr_style', '') == 'short',
-                     "applies only when using short float repr style")
 class StrtodTests(unittest.TestCase):
     def check_strtod(self, s):
         """Compare the result of Python's builtin correctly rounded


More information about the Python-checkins mailing list