cpython: f40984e7ceea (original) (raw)
Mercurial > cpython
changeset 95253:f40984e7ceea 2.7
Issue #22390: test.regrtest now emits a warning if temporary files or directories are left after running a test. [#22390]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Mon, 30 Mar 2015 01:27:44 +0300 |
parents | b11f54a0f5e2 |
children | 207db4338706 |
files | Lib/test/regrtest.py Misc/NEWS |
diffstat | 2 files changed, 15 insertions(+), 1 deletions(-)[+] [-] Lib/test/regrtest.py 13 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -773,7 +773,7 @@ class saved_test_environment: resources = ('sys.argv', 'cwd', 'sys.stdin', 'sys.stdout', 'sys.stderr', 'os.environ', 'sys.path', 'asyncore.socket_map',
'test_support.TESTFN',[](#l1.7)
'files',[](#l1.8) )[](#l1.9)
def get_sys_argv(self): @@ -840,6 +840,17 @@ class saved_test_environment: elif os.path.isdir(test_support.TESTFN): shutil.rmtree(test_support.TESTFN)
- def get_files(self):
return sorted(fn + ('/' if os.path.isdir(fn) else '')[](#l1.17)
for fn in os.listdir(os.curdir))[](#l1.18)
- def restore_files(self, saved_value):
fn = support.TESTFN[](#l1.20)
if fn not in saved_value and (fn + '/') not in saved_value:[](#l1.21)
if os.path.isfile(fn):[](#l1.22)
support.unlink(fn)[](#l1.23)
elif os.path.isdir(fn):[](#l1.24)
support.rmtree(fn)[](#l1.25)
+ def resource_info(self): for name in self.resources: method_suffix = name.replace('.', '_')
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -182,6 +182,9 @@ Tools/Demos Tests ----- +- Issue #22390: test.regrtest now emits a warning if temporary files or