diff options
Diffstat (limited to 'Lib/unittest/result.py')
| -rw-r--r-- | Lib/unittest/result.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py index 7757dba..3ace0a5 100644 --- a/Lib/unittest/result.py +++ b/Lib/unittest/result.py @@ -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.""" |
