[Python-checkins] CVS: python/dist/src/Lib/test regrtest.py,1.14,1.15

Guido van Rossum python-dev@python.org
2000年4月21日 17:35:09 -0400 (EDT)


Update of /projects/cvsroot/python/dist/src/Lib/test
In directory eric:/projects/python/develop/guido/src/Lib/test
Modified Files:
	regrtest.py 
Log Message:
Patch by Vladimir Marangozov to unload additionally imported modules
after each test has been run. This avoids excessive memory growth
during the tests.
Index: regrtest.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/test/regrtest.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** regrtest.py	1999年01月28日 19:51:51	1.14
--- regrtest.py	2000年04月21日 21:35:06	1.15
***************
*** 106,109 ****
--- 106,110 ----
 tests = tests[:1]
 test_support.verbose = verbose # Tell tests to be moderately quiet
+ save_modules = sys.modules.keys()
 for test in tests:
 if not quiet:
***************
*** 119,122 ****
--- 120,127 ----
 print "skipped -- an optional feature could not be imported"
 skipped.append(test)
+ # Unload the newly imported modules (best effort finalization)
+ for module in sys.modules.keys():
+ if module not in save_modules:
+ test_support.unload(module)
 if good and not quiet:
 if not bad and not skipped and len(good) > 1:

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