changeset 21375:bd70dcb91af6

run-tests: move umask into TestRunner.run() We now properly restore the umask as well, since run() tries to clean up after itself.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 20 Apr 2014 10:06:19 -0700
parents 592b3d2616d7
children e4366bc08879
files tests/run-tests.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun Apr 20 10:05:00 2014 -0700
+++ b/tests/run-tests.py	Sun Apr 20 10:06:19 2014 -0700
@@ -1016,9 +1016,13 @@
 
     def run(self, args):
         """Run the test suite."""
-        self._checktools()
-        tests = self.findtests(args)
-        return self._run(tests)
+        oldmask = os.umask(022)
+        try:
+            self._checktools()
+            tests = self.findtests(args)
+            return self._run(tests)
+        finally:
+            os.umask(oldmask)
 
     def _run(self, tests):
         if self.options.random:
@@ -1459,7 +1463,6 @@
     parser = parser or getparser()
     (options, args) = parseargs(args, parser)
     runner.options = options
-    os.umask(022)
 
     return runner.run(args)