diff options
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index 071d217..4251090 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -773,6 +773,14 @@ class RoundTestCase(unittest.TestCase): test(sfmt, NAN, ' nan') test(sfmt, -NAN, ' nan') + def test_None_ndigits(self): + for x in round(1.23), round(1.23, None), round(1.23, ndigits=None): + self.assertEqual(x, 1) + self.assertIsInstance(x, int) + for x in round(1.78), round(1.78, None), round(1.78, ndigits=None): + self.assertEqual(x, 2) + self.assertIsInstance(x, int) + # Beginning with Python 2.6 float has cross platform compatible # ways to create and represent inf and nan |