From 46c5d5355ea5127695984b74342c77d23d8858e6 Mon Sep 17 00:00:00 2001 From: feuillemorte Date: Mon, 26 Feb 2018 17:19:58 +0300 Subject: [PATCH 1/4] #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): From 6200920dc388ac8d7822684610ebef7c544341fc Mon Sep 17 00:00:00 2001 From: feuillemorte Date: Mon, 26 Feb 2018 17:24:16 +0300 Subject: [PATCH 2/4] #3203 Added changelog file --- changelog/3203.trivial | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/3203.trivial diff --git a/changelog/3203.trivial b/changelog/3203.trivial new file mode 100644 index 000000000..25d040b39 --- /dev/null +++ b/changelog/3203.trivial @@ -0,0 +1 @@ +Removed progress statistic when capture option is 'no' From 31476c69abaf6f68a160084a6d4501e1535b0bb4 Mon Sep 17 00:00:00 2001 From: feuillemorte Date: Mon, 26 Feb 2018 17:39:32 +0300 Subject: [PATCH 3/4] #3203 Fix tests --- testing/test_terminal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 72a9198a8..ff4296925 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -1045,6 +1045,8 @@ class TestProgress(object): r'test_foo.py \.{5}', r'test_foobar.py \.{5}', ]) + + output = testdir.runpytest('--capture=no') assert "%]" not in output.stdout.str() From 188df8100c2db0e53b760996a88925ab55973253 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 26 Feb 2018 17:14:28 -0300 Subject: [PATCH 4/4] Small adjustment to the CHANGELOG --- changelog/3203.bugfix.rst | 1 + changelog/3203.trivial | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 changelog/3203.bugfix.rst delete mode 100644 changelog/3203.trivial 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/changelog/3203.trivial b/changelog/3203.trivial deleted file mode 100644 index 25d040b39..000000000 --- a/changelog/3203.trivial +++ /dev/null @@ -1 +0,0 @@ -Removed progress statistic when capture option is 'no'