summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_float.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-10-28 23:42:48 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-10-28 23:42:48 (GMT)
commitb3b8ba6121c0bef4227efa3c644dda4f819c10b4 (patch)
tree103416d5d41fcd3f5851118659373378d51869ef /Lib/test/test_float.py
parent5a8f03f6634bd52fff2413335e84877acef6a135 (diff)
downloadcpython-b3b8ba6121c0bef4227efa3c644dda4f819c10b4.zip
cpython-b3b8ba6121c0bef4227efa3c644dda4f819c10b4.tar.gz
cpython-b3b8ba6121c0bef4227efa3c644dda4f819c10b4.tar.bz2
bring is_integer into tested existence
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r--Lib/test/test_float.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index 1968b8a..4d7bbba 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)),