diff options
author | Eric Smith <eric@trueblade.com> | 2009-05-06 13:08:15 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2009-05-06 13:08:15 (GMT) |
commit | 741191f17a921191355c1a67ca9f7fda08c3ae57 (patch) | |
tree | 2ead9e0086ce417631365543e133a789d9f75eeb /Lib/test/test_float.py | |
parent | 5776c1623c1d14b8624547db5755fec8d60fc8ed (diff) | |
download | cpython-741191f17a921191355c1a67ca9f7fda08c3ae57.zip cpython-741191f17a921191355c1a67ca9f7fda08c3ae57.tar.gz cpython-741191f17a921191355c1a67ca9f7fda08c3ae57.tar.bz2 |
Issue #3382. float 'F' formatting no longer maps to 'f'. This only affects nan and inf.
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index b617fa3..c259d4f 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -320,6 +320,12 @@ class FormatTestCase(unittest.TestCase): self.assertRaises(ValueError, format, 1e-100, format_spec) self.assertRaises(ValueError, format, -1e-100, format_spec) + # issue 3382 + self.assertEqual(format(NAN, 'f'), 'nan') + self.assertEqual(format(NAN, 'F'), 'NAN') + self.assertEqual(format(INF, 'f'), 'inf') + self.assertEqual(format(INF, 'F'), 'INF') + @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), "test requires IEEE 754 doubles") def test_format_testfile(self): |