We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc94cb1 commit 8114c8dCopy full SHA for 8114c8d
1 file changed
Lib/test/test_xml_etree_c.py
@@ -1,6 +1,7 @@
1
# xml.etree test for cElementTree
2
import io
3
import struct
4
+import sys
5
from test import support
6
from test.support.import_helper import import_fresh_module
7
import types
@@ -171,6 +172,15 @@ def test_xmlpullparser_leaks(self):
171
172
del parser
173
support.gc_collect()
174
175
+ @support.refcount_test
176
+ def test_xmlparser_refleaks_in___init__(self):
177
+ gettotalrefcount = support.get_attribute(sys, 'gettotalrefcount')
178
+ parser = cET.XMLParser()
179
+ refs_before = gettotalrefcount()
180
+ for _ in range(100):
181
+ parser.__init__()
182
+ self.assertAlmostEqual(gettotalrefcount() - refs_before, 0, delta=10)
183
+
184
def test_dict_disappearing_during_get_item(self):
185
# test fix for seg fault reported in issue 27946
186
class X:
0 commit comments