]> granicus.if.org Git - python/commitdiff
Fix a misnamed test for lists. (GH-11933)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 19 Feb 2019 11:53:07 +0000 (13:53 +0200)
committerGitHub <noreply@github.com>
Tue, 19 Feb 2019 11:53:07 +0000 (13:53 +0200)
Lib/test/list_tests.py

index ed63fda20c1b7a751204d792b592a70e014fbe4e..40316de220fac2ca2e976f2f60fa686a440c8d6b 100644 (file)
@@ -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):