diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-05-18 22:47:16 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-05-18 22:47:16 (GMT) |
commit | 08231a9c6aeb8315803ede4ba3fecd378cfb1e3f (patch) | |
tree | 901d68b6602b0d6eae8bd1edd33fcdcfc3393b83 /Lib/test | |
parent | 90a24270f8a76fffbce0a09fb0e879d9ac60cabe (diff) | |
download | cpython-08231a9c6aeb8315803ede4ba3fecd378cfb1e3f.zip cpython-08231a9c6aeb8315803ede4ba3fecd378cfb1e3f.tar.gz cpython-08231a9c6aeb8315803ede4ba3fecd378cfb1e3f.tar.bz2 |
Issue #17901: fix TreeBuilder construction for an explicit element_factory=None
Based on report and patch by Aaron Oakley.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_xml_etree.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index f3683f2..7e0f25a 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -1762,6 +1762,12 @@ class TreeBuilderTest(unittest.TestCase): parser.feed(self.sample1) self.assertIsNone(parser.close()) + def test_treebuilder_elementfactory_none(self): + parser = ET.XMLParser(target=ET.TreeBuilder(element_factory=None)) + parser.feed(self.sample1) + e = parser.close() + self._check_sample1_element(e) + def test_subclass(self): class MyTreeBuilder(ET.TreeBuilder): def foobar(self, x): |