From: Benjamin Peterson Date: Fri, 28 Oct 2011 23:42:48 +0000 (-0400) Subject: bring is_integer into tested existence X-Git-Tag: v3.2.3rc1~461 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b3b8ba6121c0bef4227efa3c644dda4f819c10b4;p=thirdparty%2FPython%2Fcpython.git bring is_integer into tested existence --- diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index 1968b8ae78e6..4d7bbbae1705 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -128,6 +128,12 @@ class GeneralFloatCases(unittest.TestCase): self.assertRaises(TypeError, float, Foo4(42)) self.assertAlmostEqual(float(FooStr('8')), 9.) + def test_is_integer(self): + self.assertFalse((1.1).is_integer()) + self.assertTrue((1.).is_integer()) + self.assertFalse(float("nan").is_integer()) + self.assertFalse(float("inf").is_integer()) + def test_floatasratio(self): for f, ratio in [ (0.875, (7, 8)),