cpython: 281ab7954d7c (original) (raw)

--- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -346,7 +346,18 @@ class Regrtest: print(count(len(self.bad), 'test'), "failed again:") printlist(self.bad)

+

for test_index, test in enumerate(self.tests, 1): @@ -354,19 +365,15 @@ class Regrtest: if self.ns.trace: # If we're tracing code coverage, then we don't exit with status # if on a false return value from main.

+ if self.ns.findleaks: gc.collect() if gc.garbage: @@ -376,13 +383,14 @@ class Regrtest: # them again self.found_garbage.extend(gc.garbage) del gc.garbage[:] + # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): support.unload(module) def run_tests(self):

if self.ns.forever: @@ -404,7 +412,7 @@ class Regrtest: from test.libregrtest.runtest_mp import run_tests_multiprocess run_tests_multiprocess(self) else:

def finalize(self): if self.next_single_filename: