From: Mark Dickinson Date: Tue, 24 Nov 2009 11:00:21 +0000 (+0000) Subject: Merged revisions 76485 via svnmerge from X-Git-Tag: v3.1.2rc1~309 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae31a7c78eed29b628bc650a083c3645b6daf0c2;p=python Merged revisions 76485 via svnmerge from svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r76485 | mark.dickinson | 2009-11-24 10:59:34 +0000 (Tue, 24 Nov 2009) | 9 lines Merged revisions 76483 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76483 | mark.dickinson | 2009-11-24 10:54:58 +0000 (Tue, 24 Nov 2009) | 2 lines round(0, "ermintrude") succeeded instead of producing a TypeError. Fix this. ........ ................ --- diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index 8ac936a93a..ebb666b6d9 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -417,6 +417,10 @@ class RoundTestCase(unittest.TestCase): self.assertRaises(OverflowError, round, INF) self.assertRaises(OverflowError, round, -INF) self.assertRaises(ValueError, round, NAN) + self.assertRaises(TypeError, round, INF, 0.0) + self.assertRaises(TypeError, round, -INF, 1.0) + self.assertRaises(TypeError, round, NAN, "ceci n'est pas un integer") + self.assertRaises(TypeError, round, -0.0, 1j) @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), "test requires IEEE 754 doubles")