Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-142145: relax the no-longer-quadratic test timing
  • Loading branch information
gpshead committed Dec 20, 2025
commit e512b02d9bfa3ccdda9d1cde52eb85e8aa374b6b
10 changes: 7 additions & 3 deletions Lib/test/test_minidom.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,18 @@ def testAppendChildNoQuadraticComplexity(self):
children = [newdoc.createElement(f"child-{i}") for i in range(1, 2 ** 15 + 1)]
element = top_element

start = time.time()
start = time.monotonic()
for child in children:
element.appendChild(child)
element = child
end = time.time()
end = time.monotonic()

# This example used to take at least 30 seconds.
self.assertLess(end - start, 1)
# Conservative assertion due to the wide variety of systems and
# build configs timing based tests wind up run under.
# A --with-address-sanitizer --with-pydebug build on a rpi5 still
# completes this loop in <0.5 seconds.
self.assertLess(end - start, 4)

def testSetAttributeNodeWithoutOwnerDocument(self):
# regression test for gh-142754
Expand Down
Loading