diff options
Diffstat (limited to 'python')
| -rwxr-xr-x | python/subunit/run.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/subunit/run.py b/python/subunit/run.py index 5c440eb..7925512 100755 --- a/python/subunit/run.py +++ b/python/subunit/run.py @@ -49,6 +49,9 @@ if __name__ == '__main__': if has_discover: parser.add_option("--discover", dest="discover", action="store_true", help="Use test discovery on the given testspec.") + parser.add_option("--discover-pattern", dest="discover_pattern", + help="The pattern that discovery should match. Default " + "'test*.py'", default="test*.py") options, args = parser.parse_args() stream = get_default_formatter() runner = SubunitTestRunner(stream) @@ -56,7 +59,8 @@ if __name__ == '__main__': loader = discover.DiscoveringTestLoader() test = TestSuite() for arg in args: - test.addTest(loader.discover(arg)) + test.addTest(loader.discover( + arg, pattern=options.discover_pattern)) result = runner.run(test) sys.exit(not result.wasSuccessful()) program = TestProgram(module=None, argv=[sys.argv[0]] + args, |
