]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-138584: Increase test coverage for `collections.UserList` (GH-138590) ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 7 Sep 2025 10:42:19 +0000 (12:42 +0200)
committerGitHub <noreply@github.com>
Sun, 7 Sep 2025 10:42:19 +0000 (10:42 +0000)
Co-authored-by: dbXD320 <devanshbaghla320@gmail.com>
Co-authored-by: Devansh Baghla <devanshbaghla34@gmail.com>
Lib/test/list_tests.py

index 68d6bad2094268a9e70687a97917e6c013a4640d..e76f79c274e744a990e14721443a431ab1c131a3 100644 (file)
@@ -32,13 +32,13 @@ class CommonTest(seq_tests.CommonTest):
         self.assertEqual(a, b)
 
     def test_getitem_error(self):
-        a = []
+        a = self.type2test([])
         msg = "list indices must be integers or slices"
         with self.assertRaisesRegex(TypeError, msg):
             a['a']
 
     def test_setitem_error(self):
-        a = []
+        a = self.type2test([])
         msg = "list indices must be integers or slices"
         with self.assertRaisesRegex(TypeError, msg):
             a['a'] = "python"
@@ -561,7 +561,7 @@ class CommonTest(seq_tests.CommonTest):
         class F(object):
             def __iter__(self):
                 raise KeyboardInterrupt
-        self.assertRaises(KeyboardInterrupt, list, F())
+        self.assertRaises(KeyboardInterrupt, self.type2test, F())
 
     def test_exhausted_iterator(self):
         a = self.type2test([1, 2, 3])