From: Benjamin Peterson Date: Fri, 28 Oct 2011 23:42:48 +0000 (-0400) Subject: bring is_integer into tested existence X-Git-Tag: v2.7.3rc1~362 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e96102b45b943bbd0d6a29e6617c14ef1ef0bd16;p=python bring is_integer into tested existence --- diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index eb119ce6f0..42463713cd 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -164,6 +164,12 @@ class GeneralFloatCases(unittest.TestCase): self.assertAlmostEqual(float(FooUnicode('8')), 9.) 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)),