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

Method test_subclass

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

Source from the content-addressed store, hash-verified

3831 self._check_sample1_element(e)
3832
3833 def test_subclass(self):
3834 class MyTreeBuilder(ET.TreeBuilder):
3835 def foobar(self, x):
3836 return x * 2
3837
3838 tb = MyTreeBuilder()
3839 self.assertEqual(tb.foobar(10), 20)
3840
3841 parser = ET.XMLParser(target=tb)
3842 parser.feed(self.sample1)
3843
3844 e = parser.close()
3845 self._check_sample1_element(e)
3846
3847 def test_subclass_comment_pi(self):
3848 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