diff options
Diffstat (limited to 'lib/subunit/python/subunit/run.py')
-rwxr-xr-x | lib/subunit/python/subunit/run.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/subunit/python/subunit/run.py b/lib/subunit/python/subunit/run.py index ca5fe5c17e..b5ccea449d 100755 --- a/lib/subunit/python/subunit/run.py +++ b/lib/subunit/python/subunit/run.py @@ -34,13 +34,22 @@ from testtools.run import ( class SubunitTestRunner(object): - def __init__(self, stream=sys.stdout): - self.stream = stream + def __init__(self, verbosity=None, failfast=None, buffer=None, stream=None): + """Create a TestToolsTestRunner. + + :param verbosity: Ignored. + :param failfast: Stop running tests at the first failure. + :param buffer: Ignored. + """ + self.failfast = failfast + self.stream = stream or sys.stdout def run(self, test): "Run the given test case or test suite." result = TestProtocolClient(self.stream) result = AutoTimingTestResultDecorator(result) + if self.failfast is not None: + result.failfast = self.failfast test(result) return result @@ -70,6 +79,6 @@ class SubunitTestProgram(TestProgram): if __name__ == '__main__': stream = get_default_formatter() - runner = SubunitTestRunner(stream) + runner = SubunitTestRunner SubunitTestProgram(module=None, argv=sys.argv, testRunner=runner, stdout=sys.stdout) |