diff options
author | Robert Collins <robertc@robertcollins.net> | 2013-04-08 22:10:15 +1200 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2013-04-08 22:10:15 +1200 |
commit | 6e5c6d37748ecd8f590348605967c6b26a6da2d9 (patch) | |
tree | 4e3f7f2b4b2835ce387f5b5b92ba0abb4770ae99 | |
parent | c64ec4fe698cc337a415baafe562f6d45d7e78f9 (diff) | |
download | testrepository-6e5c6d37748ecd8f590348605967c6b26a6da2d9.tar.gz |
Fix subunit v1 parallel test execution.
-rw-r--r-- | testrepository/commands/load.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/testrepository/commands/load.py b/testrepository/commands/load.py index c2fe2bf..a925617 100644 --- a/testrepository/commands/load.py +++ b/testrepository/commands/load.py @@ -88,10 +88,16 @@ class load(Command): else: # Calls TestResult API. case = subunit.ProtocolTestCase(stream) + def wrap_result(result): + # Wrap in a router to mask out startTestRun/stopTestRun from the + # ExtendedToStreamDecorator. + result = testtools.StreamResultRouter( + result, do_start_stop_run=False) + # Wrap that in ExtendedToStreamDecorator to convert v1 calls to + # StreamResult. + return testtools.ExtendedToStreamDecorator(result) # Now calls StreamResult API :). - case = testtools.DecorateTestCaseResult( - case, - testtools.ExtendedToStreamDecorator, + case = testtools.DecorateTestCaseResult(case, wrap_result, methodcaller('startTestRun'), methodcaller('stopTestRun')) case = testtools.DecorateTestCaseResult(case, |