mirror of
https://github.com/python/cpython.git
synced 2026-06-17 08:31:15 -04:00
Make a GC run before trying to clean up files left over by
the latest test run.
This commit is contained in:
@@ -978,6 +978,12 @@ def runtest_inner(test, verbose, quiet,
|
||||
def cleanup_test_droppings(testname, verbose):
|
||||
import shutil
|
||||
import stat
|
||||
import gc
|
||||
|
||||
# First kill any dangling references to open files etc.
|
||||
# This can also issue some ResourceWarnings which would otherwise get
|
||||
# triggered during the following test run, and possible produce failures.
|
||||
gc.collect()
|
||||
|
||||
# Try to clean up junk commonly left behind. While tests shouldn't leave
|
||||
# any files or directories behind, when a test fails that can be tedious
|
||||
|
||||
Reference in New Issue
Block a user