diff options
author | Mark Dickinson <mdickinson@enthought.com> | 2012-11-04 11:47:47 (GMT) |
---|---|---|
committer | Mark Dickinson <mdickinson@enthought.com> | 2012-11-04 11:47:47 (GMT) |
commit | c992fafddc6a2920084d2bce63d50d49f11854a0 (patch) | |
tree | 8a8e04de902d62a3ccc04b4f5ae5c079ea7e9cfd /Lib/test/test_range.py | |
parent | 729eda4a8c345bdfd7092dea155df22962cd0c9b (diff) | |
parent | 1321edaa55a8df94e739e6ea5e9e658f2b7bfcc2 (diff) | |
download | cpython-c992fafddc6a2920084d2bce63d50d49f11854a0.zip cpython-c992fafddc6a2920084d2bce63d50d49f11854a0.tar.gz cpython-c992fafddc6a2920084d2bce63d50d49f11854a0.tar.bz2 |
Issue #16402: Merge fix from 3.3
Diffstat (limited to 'Lib/test/test_range.py')
-rw-r--r-- | Lib/test/test_range.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py index f18046d..f088387 100644 --- a/Lib/test/test_range.py +++ b/Lib/test/test_range.py @@ -312,6 +312,15 @@ class RangeTest(unittest.TestCase): self.assertRaises(TypeError, range, IN()) + # Test use of user-defined classes in slice indices. + self.assertEqual(range(10)[:I(5)], range(5)) + + with self.assertRaises(RuntimeError): + range(0, 10)[:IX()] + + with self.assertRaises(TypeError): + range(0, 10)[:IN()] + def test_count(self): self.assertEqual(range(3).count(-1), 0) self.assertEqual(range(3).count(0), 1) |