Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b3b8ba6

Browse files
committed
bring is_integer into tested existence
1 parent 5a8f03f commit b3b8ba6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/test/test_float.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ def __float__(self):
128128
self.assertRaises(TypeError, float, Foo4(42))
129129
self.assertAlmostEqual(float(FooStr('8')), 9.)
130130

131+
def test_is_integer(self):
132+
self.assertFalse((1.1).is_integer())
133+
self.assertTrue((1.).is_integer())
134+
self.assertFalse(float("nan").is_integer())
135+
self.assertFalse(float("inf").is_integer())
136+
131137
def test_floatasratio(self):
132138
for f, ratio in [
133139
(0.875, (7, 8)),

0 commit comments

Comments
 (0)