summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2013-04-10 22:10:19 +1200
committerRobert Collins <robertc@robertcollins.net>2013-04-10 22:10:19 +1200
commit386f501e28a00e66a7f1a6cc6c3e04b7237825ff (patch)
tree2bd4fde8165bd488efdf234ec698e1c163f3ee70
parent10892056dad5f2eb482fa6a3582589d875d26023 (diff)
downloadtestrepository-386f501e28a00e66a7f1a6cc6c3e04b7237825ff.tar.gz
Drop the ExtendedToStream wrapping around UI.make_result.
-rw-r--r--testrepository/tests/ui/test_cli.py2
-rw-r--r--testrepository/ui/cli.py10
-rw-r--r--testrepository/ui/model.py7
3 files changed, 9 insertions, 10 deletions
diff --git a/testrepository/tests/ui/test_cli.py b/testrepository/tests/ui/test_cli.py
index 145daa3..cdde5ec 100644
--- a/testrepository/tests/ui/test_cli.py
+++ b/testrepository/tests/ui/test_cli.py
@@ -343,7 +343,7 @@ class TestCLITestResult(TestCase):
def _unwrap(self, result):
"""Unwrap result to get to the CLI result object."""
- return result.targets[0].decorated.decorated
+ return result.decorated.decorated
def test_format_error(self):
# CLITestResult formats errors by giving them a big fat line, a title
diff --git a/testrepository/ui/cli.py b/testrepository/ui/cli.py
index 8744281..3ac551c 100644
--- a/testrepository/ui/cli.py
+++ b/testrepository/ui/cli.py
@@ -120,9 +120,9 @@ class UI(ui.AbstractUI):
else:
serializer = StreamToExtendedDecorator(
subunit.TestProtocolClient(self._stdout))
- # By pass user transforms - just forward it all and interpret
- # everything as success.
- result = ExtendedToStreamDecorator(serializer)
+ # By pass user transforms - just forward it all,
+ result = serializer
+ # and interpret everything as success.
summary = testtools.StreamSummary()
summary.startTestRun()
summary.stopTestRun()
@@ -132,8 +132,8 @@ class UI(ui.AbstractUI):
output = CLITestResult(self, get_id, self._stdout, previous_run,
filter_tags=filter_tags)
# Apply user defined transforms.
- result = ExtendedToStreamDecorator(StreamToExtendedDecorator(output))
- return result, result
+ result = StreamToExtendedDecorator(output)
+ return result, output
def output_error(self, error_tuple):
if 'TESTR_PDB' in os.environ:
diff --git a/testrepository/ui/model.py b/testrepository/ui/model.py
index 8d86801..b49e65c 100644
--- a/testrepository/ui/model.py
+++ b/testrepository/ui/model.py
@@ -156,10 +156,9 @@ class UI(ui.AbstractUI):
yield BytesIO(stream_value)
def make_result(self, get_id, test_command, previous_run=None):
- result = testtools.ExtendedToStreamDecorator(
- testtools.StreamToExtendedDecorator(
- TestResultModel(self, get_id, previous_run)))
- return result, result
+ summary = TestResultModel(self, get_id, previous_run)
+ result = testtools.StreamToExtendedDecorator(summary)
+ return result, summary
def output_error(self, error_tuple):
self.outputs.append(('error', error_tuple))