File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments