[Python-checkins] Fix a misnamed test for lists. (GH-11933)

Serhiy Storchaka webhook-mailer at python.org
Tue Feb 19 06:53:10 EST 2019


https://github.com/python/cpython/commit/f522a57ec77921ee2e60bd4ccda3c8daa5a43e95
commit: f522a57ec77921ee2e60bd4ccda3c8daa5a43e95
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019-02-19T13:53:07+02:00
summary:

Fix a misnamed test for lists. (GH-11933)

files:
M Lib/test/list_tests.py

diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py
index ed63fda20c1b..40316de220fa 100644
--- a/Lib/test/list_tests.py
+++ b/Lib/test/list_tests.py
@@ -31,9 +31,15 @@ def test_init(self):
         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):



More information about the Python-checkins mailing list