Skip to content

Commit 2008554

Browse files
authored
Merge pull request #3263 from feuillemorte/3203-remove-statistic-indicator
#3203 Remove progress when no-capture
2 parents 44fa5a7 + 188df81 commit 2008554

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

_pytest/terminal.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ def pytest_runtest_logfinish(self, nodeid):
324324
_PROGRESS_LENGTH = len(' [100%]')
325325

326326
def _get_progress_information_message(self):
327+
if self.config.getoption('capture') == 'no':
328+
return ''
327329
collected = self._session.testscollected
328330
if collected:
329331
progress = len(self._progress_nodeids_reported) * 100 // collected

changelog/3203.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Removed progress information when capture option is ``no``.

testing/test_terminal.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,9 @@ def test_capture_no(self, many_tests_files, testdir):
10461046
r'test_foobar.py \.{5}',
10471047
])
10481048

1049+
output = testdir.runpytest('--capture=no')
1050+
assert "%]" not in output.stdout.str()
1051+
10491052

10501053
class TestProgressWithTeardown(object):
10511054
"""Ensure we show the correct percentages for tests that fail during teardown (#3088)"""

0 commit comments

Comments
 (0)