changeset 21352:39fd89fbbc3c

run-tests: move createdfiles out of a global and into TestRunner
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Apr 2014 23:39:38 -0700
parents fe5647506565
children a42a5195a182
files tests/run-tests.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sat Apr 19 23:38:10 2014 -0700
+++ b/tests/run-tests.py	Sat Apr 19 23:39:38 2014 -0700
@@ -105,8 +105,6 @@
 
 requiredtools = [os.path.basename(sys.executable), "diff", "grep", "unzip",
                  "gunzip", "bunzip2", "sed"]
-createdfiles = []
-
 defaults = {
     'jobs': ('HGTEST_JOBS', 1),
     'timeout': ('HGTEST_TIMEOUT', 180),
@@ -1251,6 +1249,7 @@
         self.tmpbinddir = None
         self.pythondir = None
         self.coveragefile = None
+        self._createdfiles = []
 
     def cleanup(self):
         """Clean up state from this test invocation."""
@@ -1260,7 +1259,7 @@
 
         vlog("# Cleaning up HGTMP", self.hgtmp)
         shutil.rmtree(self.hgtmp, True)
-        for f in createdfiles:
+        for f in self._createdfiles:
             try:
                 os.remove(f)
             except OSError:
@@ -1284,7 +1283,7 @@
             if findprogram(pyexename) != sys.executable:
                 try:
                     os.symlink(sys.executable, mypython)
-                    createdfiles.append(mypython)
+                    self._createdfiles.append(mypython)
                 except OSError, err:
                     # child processes may race, which is harmless
                     if err.errno != errno.EEXIST: