[Python-checkins] r85935 - python/branches/py3k/Lib/test/regrtest.py

antoine.pitrou python-checkins at python.org
Fri Oct 29 21:34:45 CEST 2010


Author: antoine.pitrou
Date: Fri Oct 29 21:34:45 2010
New Revision: 85935
Log:
Make a GC run before trying to clean up files left over by
the latest test run.
Modified:
 python/branches/py3k/Lib/test/regrtest.py
Modified: python/branches/py3k/Lib/test/regrtest.py
==============================================================================
--- python/branches/py3k/Lib/test/regrtest.py	(original)
+++ python/branches/py3k/Lib/test/regrtest.py	Fri Oct 29 21:34:45 2010
@@ -978,6 +978,12 @@
 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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /