diff options
author | Thomas Wouters <thomas@python.org> | 2006-04-17 13:16:50 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-04-17 13:16:50 (GMT) |
commit | 07519f8712241397bcb98efa19e2e7ec9257c18c (patch) | |
tree | a8691c2fea35506056f3103a80e5f7a5eef8d70e /Lib/test | |
parent | ba617af2989bd2eb625100b377e0cb745cae5f11 (diff) | |
download | cpython-07519f8712241397bcb98efa19e2e7ec9257c18c.zip cpython-07519f8712241397bcb98efa19e2e7ec9257c18c.tar.gz cpython-07519f8712241397bcb98efa19e2e7ec9257c18c.tar.bz2 |
Fix xrange tests now that xrange() (like many other places) no longer
silently converts floats to integers when expecting integer values.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_xrange.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_xrange.py b/Lib/test/test_xrange.py index 9f9daa7..40590cd 100644 --- a/Lib/test/test_xrange.py +++ b/Lib/test/test_xrange.py @@ -43,7 +43,10 @@ class XrangeTest(unittest.TestCase): self.assertRaises(TypeError, xrange, 1, 2, 3, 4) self.assertRaises(ValueError, xrange, 1, 2, 0) - self.assertRaises(OverflowError, xrange, 1e100, 1e101, 1e101) + self.assertRaises(TypeError, xrange, 0.0, 2, 1) + self.assertRaises(TypeError, xrange, 1, 2.0, 1) + self.assertRaises(TypeError, xrange, 1, 2, 1.0) + self.assertRaises(TypeError, xrange, 1e100, 1e101, 1e101) self.assertRaises(TypeError, xrange, 0, "spam") self.assertRaises(TypeError, xrange, 0, 42, "spam") |