gh-96844: Improve error message of list.remove (gh-106455)

This commit is contained in:
Dong-hee Na 2023-07-06 07:19:49 +09:00 committed by GitHub
parent c16ea94abc
commit 217f47d6e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View file

@ -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 />')