Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Lib/test/list_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def test_init(self):
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"
Expand Down Expand Up @@ -561,7 +561,7 @@ def test_constructor_exception_handling(self):
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])
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gh-138584: Fixed list_tests.CommonTest to use type2test in test_getitem_error, test_setitem_error, and test_constructor_exception_handling in Lib/tests/list_tests.py.
Loading