From 46c5d5355ea5127695984b74342c77d23d8858e6 Mon Sep 17 00:00:00 2001 From: feuillemorte Date: Mon, 26 Feb 2018 17:19:58 +0300 Subject: [PATCH] #3203 Remove progress when no-capture --- _pytest/terminal.py | 2 ++ testing/test_terminal.py | 1 + 2 files changed, 3 insertions(+) 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):