diff options
Diffstat (limited to 'Lib/test/list_tests.py')
-rw-r--r-- | Lib/test/list_tests.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py index ed606db..54cfb97 100644 --- a/Lib/test/list_tests.py +++ b/Lib/test/list_tests.py @@ -45,10 +45,11 @@ class CommonTest(seq_tests.CommonTest): self.assertEqual(str(a2), "[0, 1, 2, [...], 3]") self.assertEqual(repr(a2), "[0, 1, 2, [...], 3]") - l0 = [] - for i in xrange(sys.getrecursionlimit() + 100): - l0 = [l0] - self.assertRaises(RuntimeError, repr, l0) + def test_repr_deep(self): + a = self.type2test([]) + for i in range(sys.getrecursionlimit() + 100): + a = self.type2test([a]) + self.assertRaises(RuntimeError, repr, a) def test_print(self): d = self.type2test(xrange(200)) |