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

Method test_pickle_issue18997

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

Source from the content-addressed store, hash-verified

2780 self.assertEqualElements(e, e2)
2781
2782 def test_pickle_issue18997(self):
2783 for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
2784 for dumper, loader in product(self.modules, repeat=2):
2785 XMLTEXT = """<?xml version="1.0"?>
2786 <group><dogs>4</dogs>
2787 </group>"""
2788 e1 = dumper.fromstring(XMLTEXT)
2789 self.assertEqual(e1.__getstate__()['tag'], 'group')
2790 e2 = self.pickleRoundTrip(e1, 'xml.etree.ElementTree',
2791 dumper, loader, proto)
2792 self.assertEqual(e2.tag, 'group')
2793 self.assertEqual(e2[0].tag, 'dogs')
2794
2795 def test_remove_errors(self):
2796 e = ET.Element('tag')

Callers

nothing calls this directly

Calls 4

pickleRoundTripMethod · 0.80
fromstringMethod · 0.45
assertEqualMethod · 0.45
__getstate__Method · 0.45

Tested by

no test coverage detected