Commits

Mark Dickinson committed 13fcaa7

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

Comments (0)

Files changed (1)

Lib/test/test_strtod.py

 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:
 
 TEST_SIZE = 16
 
-@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