]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a misnamed test for lists. (GH-11933)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 19 Feb 2019 12:12:16 +0000 (04:12 -0800)
committerGitHub <noreply@github.com>
Tue, 19 Feb 2019 12:12:16 +0000 (04:12 -0800)
(cherry picked from commit f522a57ec77921ee2e60bd4ccda3c8daa5a43e95)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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):