MCPcopy Index your code
hub / github.com/python/cpython / test_remove_errors

Method test_remove_errors

Lib/test/test_xml_etree.py:2795–2805  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2793 self.assertEqual(e2[0].tag, 'dogs')
2794
2795 def test_remove_errors(self):
2796 e = ET.Element('tag')
2797 with self.assertRaisesRegex(ValueError,
2798 r"<Element 'subtag'.*> not in <Element 'tag'.*>"):
2799 e.remove(ET.Element('subtag'))
2800 with self.assertRaisesRegex(TypeError,
2801 r".*\bElement, not type"):
2802 e.remove(ET.Element)
2803 with self.assertRaisesRegex(TypeError,
2804 r".*\bElement, not int"):
2805 e.remove(1)
2806
2807class BadElementTest(ElementTestCase, unittest.TestCase):
2808

Callers

nothing calls this directly

Calls 2

removeMethod · 0.95
assertRaisesRegexMethod · 0.80

Tested by

no test coverage detected