diff options
author | Raymond Hettinger <python@rcn.com> | 2016-09-03 08:55:39 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2016-09-03 08:55:39 (GMT) |
commit | 3b09cd64e0a7991bcb6d3f83a0a23be2fc81213f (patch) | |
tree | c6111132a4ec6fe8f29abd76e882c58442a3d57c /Lib/test/test_builtin.py | |
parent | 25d94bbf05f37151e7e6e3a2e1cd5af4a3e5f68c (diff) | |
parent | f0f1c239e4addd15180d605306a969a627cb19d5 (diff) | |
download | cpython-3b09cd64e0a7991bcb6d3f83a0a23be2fc81213f.zip cpython-3b09cd64e0a7991bcb6d3f83a0a23be2fc81213f.tar.gz cpython-3b09cd64e0a7991bcb6d3f83a0a23be2fc81213f.tar.bz2 |
Merge
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r-- | Lib/test/test_builtin.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index acc4f9c..7741a79 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -3,6 +3,8 @@ import ast import builtins import collections +import decimal +import fractions import io import locale import os @@ -1244,6 +1246,15 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(round(5e15+2), 5e15+2) self.assertEqual(round(5e15+3), 5e15+3) + def test_bug_27936(self): + # Verify that ndigits=None means the same as passing in no argument + for x in [1234, + 1234.56, + decimal.Decimal('1234.56'), + fractions.Fraction(123456, 100)]: + self.assertEqual(round(x, None), round(x)) + self.assertEqual(type(round(x, None)), type(round(x))) + def test_setattr(self): setattr(sys, 'spam', 1) self.assertEqual(sys.spam, 1) |