Kaydet (Commit) 481ab89b authored tarafından Mark Dickinson's avatar Mark Dickinson

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

for rejection of small floats.  Thanks Alexander Belopolsky.
üst 31a673da
...@@ -1070,8 +1070,8 @@ class BuiltinTest(unittest.TestCase): ...@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment