mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-104090: Fix unittest collectedDurations resources leak (#106795)
This commit is contained in:
parent
e6f96cf9c6
commit
70b961ed93
2 changed files with 3 additions and 1 deletions
|
@ -166,7 +166,8 @@ class TestResult(object):
|
|||
"""
|
||||
# support for a TextTestRunner using an old TestResult class
|
||||
if hasattr(self, "collectedDurations"):
|
||||
self.collectedDurations.append((test, elapsed))
|
||||
# Pass test repr and not the test object itself to avoid resources leak
|
||||
self.collectedDurations.append((str(test), elapsed))
|
||||
|
||||
def wasSuccessful(self):
|
||||
"""Tells whether or not this result was a success."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue