summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/test_case.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/test/test_case.py')
-rw-r--r--Lib/unittest/test/test_case.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py
index f3cabe4..9b32da1 100644
--- a/Lib/unittest/test/test_case.py
+++ b/Lib/unittest/test/test_case.py
@@ -19,7 +19,7 @@ from unittest.test.support import (
TestEquality, TestHashing, LoggingResult, LegacyLoggingResult,
ResultWithNoStartTestRunStopTestRun
)
-from test.support import captured_stderr
+from test.support import captured_stderr, gc_collect
log_foo = logging.getLogger('foo')
@@ -1967,6 +1967,7 @@ test case
for method_name in ('test1', 'test2'):
testcase = TestCase(method_name)
testcase.run()
+ gc_collect() # For PyPy or other GCs.
self.assertEqual(MyException.ninstance, 0)