summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_float.py
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2010-11-25 16:08:06 (GMT)
committerEric Smith <eric@trueblade.com>2010-11-25 16:08:06 (GMT)
commit984bb58000df9cdba438c7ecb0bae5ad67878696 (patch)
tree87077ab2bbe949b5241ed9db5f2073572094ffde /Lib/test/test_float.py
parentc1d98d685032dd831ced32463b3f88cce6af4067 (diff)
downloadcpython-984bb58000df9cdba438c7ecb0bae5ad67878696.zip
cpython-984bb58000df9cdba438c7ecb0bae5ad67878696.tar.gz
cpython-984bb58000df9cdba438c7ecb0bae5ad67878696.tar.bz2
Issue #7094: Add alternate ('#') flag to __format__ methods for float, complex and Decimal. Allows greater control over when decimal points appear. Added to make transitioning from %-formatting easier. '#g' still has a problem with Decimal which I'll fix soon.
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r--Lib/test/test_float.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index e0479db..0072133 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -706,11 +706,8 @@ class RoundTestCase(unittest.TestCase):
def test(fmt, value, expected):
# Test with both % and format().
self.assertEqual(fmt % value, expected, fmt)
- if not '#' in fmt:
- # Until issue 7094 is implemented, format() for floats doesn't
- # support '#' formatting
- fmt = fmt[1:] # strip off the %
- self.assertEqual(format(value, fmt), expected, fmt)
+ fmt = fmt[1:] # strip off the %
+ self.assertEqual(format(value, fmt), expected, fmt)
for fmt in ['%e', '%f', '%g', '%.0e', '%.6f', '%.20g',
'%#e', '%#f', '%#g', '%#.20e', '%#.15f', '%#.3g']: