diff options
author | Robert Collins <robertc@robertcollins.net> | 2013-04-09 21:54:58 +1200 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2013-04-09 21:54:58 +1200 |
commit | dcee5da3a240a2d241589f7b2cd431e31e45580f (patch) | |
tree | ac1aac8d3ae12bbc1c6fb546eebe840c64053413 | |
parent | 425d893d8e7f48982c12442f3d374b0a7dc99afe (diff) | |
download | testrepository-dcee5da3a240a2d241589f7b2cd431e31e45580f.tar.gz |
Simplify commands.failing.
-rw-r--r-- | testrepository/commands/failing.py | 20 | ||||
-rw-r--r-- | testrepository/testcommand.py | 1 |
2 files changed, 6 insertions, 15 deletions
diff --git a/testrepository/commands/failing.py b/testrepository/commands/failing.py index 68ab890..9cc1ed7 100644 --- a/testrepository/commands/failing.py +++ b/testrepository/commands/failing.py @@ -54,20 +54,13 @@ class failing(Command): self.ui.output_stream(stream) return 0 - def _make_result(self, repo, list_result): + def _make_result(self, repo): testcommand = self.command_factory(self.ui, repo) if self.ui.options.list: - result = testcommand.make_result(list_result) - return result, result + list_result = testtools.StreamSummary() + return testcommand.make_result(list_result), list_result else: - output_result, summary_result = self.ui.make_result( - repo.latest_id, testcommand) - # This probably wants to be removed or pushed into the CLIResult - # responsibilities, it attempts to preserve skips, but the ui - # make_result filters them - a mismatch. - errors_only = TestResultFilter(output_result, filter_skip=True) - return testtools.CopyStreamResult( - [list_result, output_result]), summary_result + return self.ui.make_result(repo.latest_id, testcommand) def run(self): repo = self.repository_factory.open(self.ui.here) @@ -76,8 +69,7 @@ class failing(Command): return self._show_subunit(run) case = run.get_test() failed = False - list_result = testtools.StreamSummary() - result, summary = self._make_result(repo, list_result) + result, summary = self._make_result(repo) result.startTestRun() try: case.run(result) @@ -90,6 +82,6 @@ class failing(Command): result = 0 if self.ui.options.list: failing_tests = [ - test for test, _ in list_result.errors + list_result.failures] + test for test, _ in summary.errors + summary.failures] self.ui.output_tests(failing_tests) return result diff --git a/testrepository/testcommand.py b/testrepository/testcommand.py index e4364cd..590066e 100644 --- a/testrepository/testcommand.py +++ b/testrepository/testcommand.py @@ -27,7 +27,6 @@ import tempfile from textwrap import dedent from fixtures import Fixture -from testtools.compat import _b from testrepository.results import TestResultFilter from testrepository.testlist import ( |