mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[3.14] gh-138584: Increase test coverage for collections.UserList (GH-138590) (#138612)
Co-authored-by: dbXD320 <devanshbaghla320@gmail.com> Co-authored-by: Devansh Baghla <devanshbaghla34@gmail.com>
This commit is contained in:
parent
d36c9a8b50
commit
78ee486861
1 changed files with 3 additions and 3 deletions
|
|
@ -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"
|
||||
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue