diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2009-06-04 01:44:58 +0200 |
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2009-06-04 01:44:58 +0200 |
| commit | 001c80084a03f30810baab2a1b68669dad1413dc (patch) | |
| tree | df1b53c63d7ef40da439d89f751922529aff7583 /python/subunit/__init__.py | |
| parent | e350f90c8a21f7df8b750d6d184923b33f376ee5 (diff) | |
| download | subunit-001c80084a03f30810baab2a1b68669dad1413dc.tar.gz | |
Add trivial command-line test runner.
Diffstat (limited to 'python/subunit/__init__.py')
| -rw-r--r-- | python/subunit/__init__.py | 11 |
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 + |
