run-tests: move outputtimes() into TestRunner
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 19 Apr 2014 23:47:59 -0700
changeset 21355 d83f4e94512a
parent 21354 29629ef43d39
child 21356 f96d7dfd8cb5
run-tests: move outputtimes() into TestRunner
tests/run-tests.py
--- a/tests/run-tests.py	Sat Apr 19 23:44:56 2014 -0700
+++ b/tests/run-tests.py	Sat Apr 19 23:47:59 2014 -0700
@@ -386,14 +386,6 @@
     return killmod.killdaemons(pidfile, tryhard=False, remove=True,
                                logfn=vlog)
 
-def outputtimes(options):
-    vlog('# Producing time report')
-    times.sort(key=lambda t: (t[1], t[0]), reverse=True)
-    cols = '%7.3f   %s'
-    print '\n%-7s   %s' % ('Time', 'Test')
-    for test, timetaken in times:
-        print cols % (timetaken, test)
-
 def outputcoverage(runner):
 
     vlog('# Producing coverage report')
@@ -1126,7 +1118,7 @@
         if results['!']:
             print 'python hash seed:', os.environ['PYTHONHASHSEED']
         if runner.options.time:
-            outputtimes(runner.options)
+            runner.outputtimes()
 
         if runner.options.anycoverage:
             outputcoverage(runner)
@@ -1301,6 +1293,14 @@
                              '         (expected %s)\n'
                              % (verb, actualhg, expecthg))
 
+    def outputtimes(self):
+        vlog('# Producing time report')
+        times.sort(key=lambda t: (t[1], t[0]), reverse=True)
+        cols = '%7.3f   %s'
+        print '\n%-7s   %s' % ('Time', 'Test')
+        for test, timetaken in times:
+            print cols % (timetaken, test)
+
 def main(args, parser=None):
     runner = TestRunner()