mirror of
https://github.com/python/cpython.git
synced 2024-12-22 16:24:24 +08:00
bring is_integer into tested existence
This commit is contained in:
parent
bf0cafa773
commit
e96102b45b
@ -164,6 +164,12 @@ class GeneralFloatCases(unittest.TestCase):
|
|||||||
self.assertAlmostEqual(float(FooUnicode('8')), 9.)
|
self.assertAlmostEqual(float(FooUnicode('8')), 9.)
|
||||||
self.assertAlmostEqual(float(FooStr('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):
|
def test_floatasratio(self):
|
||||||
for f, ratio in [
|
for f, ratio in [
|
||||||
(0.875, (7, 8)),
|
(0.875, (7, 8)),
|
||||||
|
Loading…
Reference in New Issue
Block a user