summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_xml_etree.py
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-05-18 22:47:58 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-05-18 22:47:58 (GMT)
commit20c1cdd64aba14cbe7a2484f4569f3e7e4e7132a (patch)
tree86c496db3f02330cd1405521c444a2952a0b1321 /Lib/test/test_xml_etree.py
parent10e8c49a11856b26eaaf73aaee1bdad23bdbe804 (diff)
parent08231a9c6aeb8315803ede4ba3fecd378cfb1e3f (diff)
downloadcpython-20c1cdd64aba14cbe7a2484f4569f3e7e4e7132a.zip
cpython-20c1cdd64aba14cbe7a2484f4569f3e7e4e7132a.tar.gz
cpython-20c1cdd64aba14cbe7a2484f4569f3e7e4e7132a.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/test_xml_etree.py')
-rw-r--r--Lib/test/test_xml_etree.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 49a6914..f37cfe9 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -1896,6 +1896,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):