diff --git a/_pytest/terminal.py b/_pytest/terminal.py index 51d21cb33..7e034eb9a 100644 --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -324,6 +324,8 @@ class TerminalReporter(object): _PROGRESS_LENGTH = len(' [100%]') def _get_progress_information_message(self): + if self.config.getoption('capture') == 'no': + return '' collected = self._session.testscollected if collected: progress = len(self._progress_nodeids_reported) * 100 // collected diff --git a/testing/test_terminal.py b/testing/test_terminal.py index d7fabd055..72a9198a8 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -1045,6 +1045,7 @@ class TestProgress(object): r'test_foo.py \.{5}', r'test_foobar.py \.{5}', ]) + assert "%]" not in output.stdout.str() class TestProgressWithTeardown(object):