Skip to content

Commit ec362b3

Browse files
committed
Changes from review
1 parent 506e978 commit ec362b3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/test/test_minidom.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,16 @@ def testAppendChild(self):
173173
self.assertEqual(dom.documentElement.childNodes[-1].data, "Hello")
174174
dom.unlink()
175175

176+
@support.requires_resource('cpu')
176177
def testAppendChildNoQuadraticComplexity(self):
177-
# Don't use wall-clock timing (too flaky). Instead count a proxy for the
178-
# old quadratic behavior: repeated attribute access, such as of
179-
# parentNode/nodeType during document-membership checks.
180178
impl = getDOMImplementation()
181179

182180
def work(n):
183181
doc = impl.createDocument(None, "some_tag", None)
184182
element = doc.documentElement
185183
total_calls = 0
186184

185+
# Count attribute accesses as a proxy for work done
187186
def getattribute_counter(self, attr):
188187
nonlocal total_calls
189188
total_calls += 1

0 commit comments

Comments
 (0)