summaryrefslogtreecommitdiff
path: root/python/subunit
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-06-04 01:44:58 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-06-04 01:44:58 +0200
commitd14cda0c7c872b20e435b3ed563b4b1215330390 (patch)
treedf1b53c63d7ef40da439d89f751922529aff7583 /python/subunit
parent36a8fff948b6775ef1c6fc40edb68dcd89b0ed4e (diff)
downloadsubunit-git-d14cda0c7c872b20e435b3ed563b4b1215330390.tar.gz
Add trivial command-line test runner.
Diffstat (limited to 'python/subunit')
-rw-r--r--python/subunit/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index 7d800a8..23f3f07 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -774,3 +774,14 @@ class TestResultFilter(unittest.TestResult):
return id[len("subunit.RemotedTestCase."):]
return id
+
+class SubunitTestRunner(object):
+ def __init__(self, stream=sys.stdout):
+ self.stream = stream
+
+ def run(self, test):
+ "Run the given test case or test suite."
+ result = TestProtocolClient(self.stream)
+ test(result)
+ return result
+