From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 7 Sep 2025 10:42:19 +0000 (+0200) Subject: [3.14] gh-138584: Increase test coverage for `collections.UserList` (GH-138590) ... X-Git-Tag: v3.14.0rc3~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78ee4868617508a13effc6d1bfb5b187670c104b;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-138584: Increase test coverage for `collections.UserList` (GH-138590) (#138612) Co-authored-by: dbXD320 Co-authored-by: Devansh Baghla --- diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py index 68d6bad20942..e76f79c274e7 100644 --- a/Lib/test/list_tests.py +++ b/Lib/test/list_tests.py @@ -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])