diff options
-rw-r--r-- | Lib/test/list_tests.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py index ed63fda20c..40316de220 100644 --- a/Lib/test/list_tests.py +++ b/Lib/test/list_tests.py @@ -31,9 +31,15 @@ class CommonTest(seq_tests.CommonTest): self.assertEqual(a, b) def test_getitem_error(self): + a = [] + msg = "list indices must be integers or slices" + with self.assertRaisesRegex(TypeError, msg): + a['a'] + + def test_setitem_error(self): + a = [] msg = "list indices must be integers or slices" with self.assertRaisesRegex(TypeError, msg): - a = [] a['a'] = "python" def test_repr(self): |