diff options
Diffstat (limited to 'testrepository')
-rw-r--r-- | testrepository/commands/failing.py | 9 | ||||
-rw-r--r-- | testrepository/commands/last.py | 4 | ||||
-rw-r--r-- | testrepository/tests/commands/test_failing.py | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/testrepository/commands/failing.py b/testrepository/commands/failing.py index 7b25bc6..9e029de 100644 --- a/testrepository/commands/failing.py +++ b/testrepository/commands/failing.py @@ -31,6 +31,10 @@ class failing(Command): full run combined with any failures in subsequent partial runs, minus any passes that have occured in a run more recent than a given failure. Deleted tests will only be detected on full runs with this approach. + + Without --subunit, the process exit code will be non-zero if the test run + was not successful. With --subunit, the process exit code is non-zero if + the subunit stream could not be generated successfully. """ options = [ @@ -47,10 +51,7 @@ class failing(Command): def _show_subunit(self, run): stream = run.get_subunit_stream() self.ui.output_stream(stream) - if stream.tell(): - return 1 - else: - return 0 + return 0 def _make_result(self, repo, list_result): testcommand = self.command_factory(self.ui, repo) diff --git a/testrepository/commands/last.py b/testrepository/commands/last.py index 6127599..a8d7c04 100644 --- a/testrepository/commands/last.py +++ b/testrepository/commands/last.py @@ -27,6 +27,10 @@ class last(Command): Failing tests are shown on the console and a summary of the run is printed at the end. + + Without --subunit, the process exit code will be non-zero if the test run + was not successful. With --subunit, the process exit code is non-zero if + the subunit stream could not be generated successfully. """ options = [ diff --git a/testrepository/tests/commands/test_failing.py b/testrepository/tests/commands/test_failing.py index ba84592..9d6ab91 100644 --- a/testrepository/tests/commands/test_failing.py +++ b/testrepository/tests/commands/test_failing.py @@ -84,7 +84,7 @@ class TestCommand(ResourcedTestCase): Cases('failing').run(inserter) Cases('ok').run(inserter) inserter.stopTestRun() - self.assertEqual(1, cmd.execute()) + self.assertEqual(0, cmd.execute()) self.assertEqual(1, len(ui.outputs)) self.assertEqual('stream', ui.outputs[0][0]) self.assertThat(ui.outputs[0][1], DocTestMatches("""...test: ...failing |