diff options
Diffstat (limited to 'testrepository/commands/load.py')
-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, |