From 7444588c895e2dc3946d6ca3e6650d4549cd4d43 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Sun, 3 Mar 2013 23:11:19 +1300 Subject: Convert subunit.run to v2. --- python/subunit/run.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'python/subunit/run.py') diff --git a/python/subunit/run.py b/python/subunit/run.py index b5ccea4..479691d 100755 --- a/python/subunit/run.py +++ b/python/subunit/run.py @@ -22,7 +22,9 @@ import sys -from subunit import TestProtocolClient, get_default_formatter +from testtools import ExtendedToStreamDecorator + +from subunit import StreamResultToBytes, get_default_formatter from subunit.test_results import AutoTimingTestResultDecorator from testtools.run import ( BUFFEROUTPUT, @@ -46,11 +48,15 @@ class SubunitTestRunner(object): def run(self, test): "Run the given test case or test suite." - result = TestProtocolClient(self.stream) + result = ExtendedToStreamDecorator(StreamResultToBytes(self.stream)) result = AutoTimingTestResultDecorator(result) if self.failfast is not None: result.failfast = self.failfast - test(result) + result.startTestRun() + try: + test(result) + finally: + result.stopTestRun() return result -- cgit v1.2.1