projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf0cafa
)
bring is_integer into tested existence
author
Benjamin Peterson
<benjamin@python.org>
Fri, 28 Oct 2011 23:42:48 +0000
(19:42 -0400)
committer
Benjamin Peterson
<benjamin@python.org>
Fri, 28 Oct 2011 23:42:48 +0000
(19:42 -0400)
Lib/test/test_float.py
patch
|
blob
|
history
diff --git
a/Lib/test/test_float.py
b/Lib/test/test_float.py
index eb119ce6f0c19558115c8a5a227ff3fa7d474757..42463713cdc416e9c6960d327ec264ba8684f4d7 100644
(file)
--- 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)),