run-tests: move success() into Test
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 19 Apr 2014 20:35:54 -0700
changeset 21322 512968bfb00a
parent 21321 d06b09dc80a5
child 21323 a7c677e2f6ae
run-tests: move success() into Test
tests/run-tests.py
--- a/tests/run-tests.py	Sat Apr 19 20:32:38 2014 -0700
+++ b/tests/run-tests.py	Sat Apr 19 20:35:54 2014 -0700
@@ -675,6 +675,9 @@
 
         return env
 
+    def success(self):
+        return '.', self._test, ''
+
 class TestResult(object):
     """Holds the result of a test execution."""
 
@@ -1049,9 +1052,6 @@
                 return '.', test, ''
         return warned and '~' or '!', test, msg
 
-    def success():
-        return '.', test, ''
-
     def ignore(msg):
         return 'i', test, msg
 
@@ -1099,7 +1099,6 @@
     t = runner(test, testpath, options, count, ref, err)
     res = TestResult()
     t.run(res)
-    t.cleanup()
 
     if res.exception:
         return fail('Exception during execution: %s' % res.exception, 255)
@@ -1154,7 +1153,7 @@
     elif ret:
         result = fail(describe(ret), ret)
     else:
-        result = success()
+        result = t.success()
 
     if not options.verbose:
         iolock.acquire()
@@ -1162,6 +1161,8 @@
         sys.stdout.flush()
         iolock.release()
 
+    t.cleanup()
+
     return result
 
 _hgpath = None