diff options
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index 8c250e8..24202be 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -313,19 +313,6 @@ class FormatTestCase(unittest.TestCase): self.assertRaises(ValueError, format, 1e-100, format_spec) self.assertRaises(ValueError, format, -1e-100, format_spec) -class ReprTestCase(unittest.TestCase): - def test_repr(self): - floats_file = open(os.path.join(os.path.split(__file__)[0], - 'floating_points.txt')) - for line in floats_file: - line = line.strip() - if not line or line.startswith('#'): - continue - v = eval(line) - self.assertEqual(v, eval(repr(v))) - floats_file.close() - -class FormatTestCase(unittest.TestCase): @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), "test requires IEEE 754 doubles") def test_format_testfile(self): @@ -341,6 +328,18 @@ class FormatTestCase(unittest.TestCase): self.assertEqual(fmt % float(arg), rhs) self.assertEqual(fmt % -float(arg), '-' + rhs) +class ReprTestCase(unittest.TestCase): + def test_repr(self): + floats_file = open(os.path.join(os.path.split(__file__)[0], + 'floating_points.txt')) + for line in floats_file: + line = line.strip() + if not line or line.startswith('#'): + continue + v = eval(line) + self.assertEqual(v, eval(repr(v))) + floats_file.close() + @unittest.skipUnless(getattr(sys, 'float_repr_style', '') == 'short', "applies only when using short float repr style") def test_short_repr(self): @@ -390,8 +389,6 @@ class FormatTestCase(unittest.TestCase): self.assertEqual(s, repr(float(s))) self.assertEqual(negs, repr(float(negs))) - - # Beginning with Python 2.6 float has cross platform compatible # ways to create and represent inf and nan class InfNanTest(unittest.TestCase): |