summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJames Westby <james.westby@canonical.com>2010-06-07 19:37:52 +0100
committerJames Westby <james.westby@canonical.com>2010-06-07 19:37:52 +0100
commit4700d73f0ef336c6a51159bae023aa15746a1e71 (patch)
tree1c68108f6ace8e9c3ec6c2d72e9dde8e8da51218 /python
parent09798f9739047e198544e672ffc7bb5b23128d52 (diff)
downloadsubunit-git-4700d73f0ef336c6a51159bae023aa15746a1e71.tar.gz
Add --discover-pattern.
Diffstat (limited to 'python')
-rwxr-xr-xpython/subunit/run.py6
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,