run-tests: move createdfiles out of a global and into TestRunner
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 19 Apr 2014 23:39:38 -0700
changeset 21352 39fd89fbbc3c
parent 21351 fe5647506565
child 21353 a42a5195a182
run-tests: move createdfiles out of a global and into TestRunner
tests/run-tests.py
--- 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: