mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Make a GC run before trying to clean up files left over by
the latest test run.
This commit is contained in:
parent
72f48422e2
commit
c14efc4e80
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue