Skip to content

Commit 614c493

Browse files
miss-islingtondbXD320Devansh-b
authored
[3.13] pythongh-138584: Increase test coverage for collections.UserList (pythonGH-138590) (python#138611)
pythongh-138584: Increase test coverage for `collections.UserList` (pythonGH-138590) Some common tests in `test.list_tests.CommonTest` explicitly tested `list` instead of testing the underlying list-like type defined in `type2test`. --------- (cherry picked from commit d7b9ea5) Co-authored-by: dbXD320 <[email protected]> Co-authored-by: Devansh Baghla <[email protected]>
1 parent e5bbcb1 commit 614c493

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/list_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ def test_init(self):
3131
self.assertEqual(a, b)
3232

3333
def test_getitem_error(self):
34-
a = []
34+
a = self.type2test([])
3535
msg = "list indices must be integers or slices"
3636
with self.assertRaisesRegex(TypeError, msg):
3737
a['a']
3838

3939
def test_setitem_error(self):
40-
a = []
40+
a = self.type2test([])
4141
msg = "list indices must be integers or slices"
4242
with self.assertRaisesRegex(TypeError, msg):
4343
a['a'] = "python"
@@ -558,7 +558,7 @@ def test_constructor_exception_handling(self):
558558
class F(object):
559559
def __iter__(self):
560560
raise KeyboardInterrupt
561-
self.assertRaises(KeyboardInterrupt, list, F())
561+
self.assertRaises(KeyboardInterrupt, self.type2test, F())
562562

563563
def test_exhausted_iterator(self):
564564
a = self.type2test([1, 2, 3])

0 commit comments

Comments
 (0)