summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_float.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r--Lib/test/test_float.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index fb6daaf..b617fa3 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -284,6 +284,13 @@ class FormatTestCase(unittest.TestCase):
self.assertEqual(format(0.01, ''), '0.01')
self.assertEqual(format(0.01, 'g'), '0.01')
+ # empty presentation type should format in the same way as str
+ # (issue 5920)
+ x = 100/7.
+ self.assertEqual(format(x, ''), str(x))
+ self.assertEqual(format(x, '-'), str(x))
+ self.assertEqual(format(x, '>'), str(x))
+ self.assertEqual(format(x, '2'), str(x))
self.assertEqual(format(1.0, 'f'), '1.000000')