summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-02-07 20:31:10 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-02-07 20:31:10 (GMT)
commit841e7f3ae20c87651b8dd94b2ed9cdad39d80ba5 (patch)
treedcdfc38b0261572df679703e521535d3d48af925
parentdd25e86cf47365269466bf0d28367d5f6dbc0c18 (diff)
downloadcpython-841e7f3ae20c87651b8dd94b2ed9cdad39d80ba5.zip
cpython-841e7f3ae20c87651b8dd94b2ed9cdad39d80ba5.tar.gz
cpython-841e7f3ae20c87651b8dd94b2ed9cdad39d80ba5.tar.bz2
Skip test_strtod entirely when correctly-rounded string->float isn't implemented
-rw-r--r--Lib/test/test_strtod.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_strtod.py b/Lib/test/test_strtod.py
index c756266..0e67e8d 100644
--- a/Lib/test/test_strtod.py
+++ b/Lib/test/test_strtod.py
@@ -8,6 +8,10 @@ import re
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 @@ def strtod(s, mant_dig=53, min_exp = -1021, max_exp = 1024):
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