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/changelog/3203.bugfix.rst b/changelog/3203.bugfix.rst new file mode 100644 index 000000000..88f357722 --- /dev/null +++ b/changelog/3203.bugfix.rst @@ -0,0 +1 @@ +Removed progress information when capture option is ``no``. diff --git a/testing/test_terminal.py b/testing/test_terminal.py index d7fabd055..ff4296925 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -1046,6 +1046,9 @@ class TestProgress(object): r'test_foobar.py \.{5}', ]) + output = testdir.runpytest('--capture=no') + assert "%]" not in output.stdout.str() + class TestProgressWithTeardown(object): """Ensure we show the correct percentages for tests that fail during teardown (#3088)"""