diff options
Diffstat (limited to 'Lib/test/list_tests.py')
-rw-r--r-- | Lib/test/list_tests.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py index f20fdc0a5f..26e93687f4 100644 --- a/Lib/test/list_tests.py +++ b/Lib/test/list_tests.py @@ -266,9 +266,21 @@ class CommonTest(seq_tests.CommonTest): self.assertEqual(a, list("spameggs")) self.assertRaises(TypeError, a.extend, None) - self.assertRaises(TypeError, a.extend) + # overflow test. issue1621 + class CustomIter: + def __iter__(self): + return self + def __next__(self): + raise StopIteration + def __length_hint__(self): + return sys.maxsize + a = self.type2test([1,2,3,4]) + a.extend(CustomIter()) + self.assertEqual(a, [1,2,3,4]) + + def test_insert(self): a = self.type2test([0, 1, 2]) a.insert(0, -2) |