run-tests: allow TestRunner to be passed into main()
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 20 Apr 2014 09:40:27 -0700
changeset 21364 558246fa98b8
parent 21363 00e5f5b9fc90
child 21365 10cf9054d941
run-tests: allow TestRunner to be passed into main() This allows 3rd parties to specify a custom TestRunner. This is useful for providing your own test discovery mechanism, for example.
tests/run-tests.py
--- a/tests/run-tests.py	Sun Apr 20 00:23:06 2014 -0700
+++ b/tests/run-tests.py	Sun Apr 20 09:40:27 2014 -0700
@@ -1331,8 +1331,8 @@
         except KeyboardInterrupt:
             self.abort[0] = True
 
-def main(args, parser=None):
-    runner = TestRunner()
+def main(args, runner=None, parser=None):
+    runner = runner or TestRunner()
 
     parser = parser or getparser()
     (options, args) = parseargs(args, parser)