Skip to content

Commit 78ee486

Browse files
miss-islingtondbXD320Devansh-b
authored
[3.14] gh-138584: Increase test coverage for collections.UserList (GH-138590) (#138612)
Co-authored-by: dbXD320 <[email protected]> Co-authored-by: Devansh Baghla <[email protected]>
1 parent d36c9a8 commit 78ee486

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
@@ -32,13 +32,13 @@ def test_init(self):
3232
self.assertEqual(a, b)
3333

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

4040
def test_setitem_error(self):
41-
a = []
41+
a = self.type2test([])
4242
msg = "list indices must be integers or slices"
4343
with self.assertRaisesRegex(TypeError, msg):
4444
a['a'] = "python"
@@ -561,7 +561,7 @@ def test_constructor_exception_handling(self):
561561
class F(object):
562562
def __iter__(self):
563563
raise KeyboardInterrupt
564-
self.assertRaises(KeyboardInterrupt, list, F())
564+
self.assertRaises(KeyboardInterrupt, self.type2test, F())
565565

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

0 commit comments

Comments
 (0)