Issue #1533: test_range in test_builtin: fix test comment and add test

for rejection of small floats.  Thanks Alexander Belopolsky.
This commit is contained in:
Mark Dickinson 2010-05-05 22:42:51 +00:00
parent 31a673da52
commit 481ab89b75
1 changed files with 2 additions and 2 deletions

View File

@ -1070,8 +1070,8 @@ class BuiltinTest(unittest.TestCase):
__hash__ = None # Invalid cmp makes this unhashable __hash__ = None # Invalid cmp makes this unhashable
self.assertRaises(RuntimeError, range, a, a + 1, badzero(1)) self.assertRaises(RuntimeError, range, a, a + 1, badzero(1))
# Reject floats when it would require PyLongs to represent. # Reject floats.
# (smaller floats still accepted, but deprecated) self.assertRaises(TypeError, range, 1., 1., 1.)
self.assertRaises(TypeError, range, 1e100, 1e101, 1e101) self.assertRaises(TypeError, range, 1e100, 1e101, 1e101)
self.assertRaises(TypeError, range, 0, "spam") self.assertRaises(TypeError, range, 0, "spam")