mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
gh-96844: Improve error message of list.remove (gh-106455)
This commit is contained in:
parent
c16ea94abc
commit
217f47d6e5
4 changed files with 6 additions and 5 deletions
|
|
@ -328,7 +328,7 @@ class ElementTreeTest(unittest.TestCase):
|
|||
self.serialize_check(element, '<tag key="value" />') # 5
|
||||
with self.assertRaises(ValueError) as cm:
|
||||
element.remove(subelement)
|
||||
self.assertEqual(str(cm.exception), 'list.remove(x): x not in list')
|
||||
self.assertIn('not in list', str(cm.exception))
|
||||
self.serialize_check(element, '<tag key="value" />') # 6
|
||||
element[0:0] = [subelement, subelement, subelement]
|
||||
self.serialize_check(element[1], '<subtag />')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue