MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_subclass

Method test_subclass

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

Source from the content-addressed store, hash-verified

3791 self._check_sample1_element(e)
3792
3793 def test_subclass(self):
3794 class MyTreeBuilder(ET.TreeBuilder):
3795 def foobar(self, x):
3796 return x * 2
3797
3798 tb = MyTreeBuilder()
3799 self.assertEqual(tb.foobar(10), 20)
3800
3801 parser = ET.XMLParser(target=tb)
3802 parser.feed(self.sample1)
3803
3804 e = parser.close()
3805 self._check_sample1_element(e)
3806
3807 def test_subclass_comment_pi(self):
3808 class MyTreeBuilder(ET.TreeBuilder):

Callers

nothing calls this directly

Calls 6

foobarMethod · 0.95
feedMethod · 0.95
closeMethod · 0.95
MyTreeBuilderClass · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected