changeset 21452:1517c0461b75

run-tests: move some functionality to Test.tearDown()
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 20 Apr 2014 15:16:29 -0700
parents 1b3a1ebdcfee
children aaf52b78327e
files tests/run-tests.py
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun Apr 20 15:08:05 2014 -0700
+++ b/tests/run-tests.py	Sun Apr 20 15:16:29 2014 -0700
@@ -514,16 +514,6 @@
             self._result = self.success()
 
 
-        vlog("# Ret was:", ret)
-
-        # Don't print progress in unittest mode because that is handled
-        # by TestResult.
-        if not options.verbose and not self._unittest:
-            iolock.acquire()
-            sys.stdout.write(self._result[0])
-            sys.stdout.flush()
-            iolock.release()
-
         if not self._unittest:
             self.tearDown()
 
@@ -531,6 +521,16 @@
 
     def tearDown(self):
         """Tasks to perform after run()."""
+        vlog("# Ret was:", self._ret)
+
+        # Don't print progress in unittest mode because that is handled
+        # by TestResult.
+        if not self._options.verbose and not self._unittest:
+            iolock.acquire()
+            sys.stdout.write(self._result[0])
+            sys.stdout.flush()
+            iolock.release()
+
         self._runner.times.append((self.name, self._duration))
 
     def _run(self, testtmp, replacements, env):