diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_xml_etree_c.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py index 87f3f27abc..7c60699f91 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -11,6 +11,7 @@ cET_alias = import_fresh_module('xml.etree.cElementTree', fresh=['_elementtree', 'xml.etree']) +@unittest.skipUnless(cET, 'requires _elementtree') class MiscTests(unittest.TestCase): # Issue #8651. @support.bigmemtest(size=support._2G + 100, memuse=1, dry_run=False) @@ -54,6 +55,15 @@ class MiscTests(unittest.TestCase): del element.attrib self.assertEqual(element.attrib, {'A': 'B', 'C': 'D'}) + def test_trashcan(self): + # If this test fails, it will most likely die via segfault. + e = root = cET.Element('root') + for i in range(200000): + e = cET.SubElement(e, 'x') + del e + del root + support.gc_collect() + @unittest.skipUnless(cET, 'requires _elementtree') class TestAliasWorking(unittest.TestCase): |