Skip to content

Commit

Permalink
Merge pull request #3263 from feuillemorte/3203-remove-statistic-indi…
Browse files Browse the repository at this point in the history
…cator

#3203 Remove progress when no-capture
  • Loading branch information
nicoddemus authored Feb 27, 2018
2 parents 44fa5a7 + 188df81 commit 2008554
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _pytest/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ def pytest_runtest_logfinish(self, nodeid):
_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
Expand Down
1 change: 1 addition & 0 deletions changelog/3203.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed progress information when capture option is ``no``.
3 changes: 3 additions & 0 deletions testing/test_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,9 @@ def test_capture_no(self, many_tests_files, testdir):
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)"""
Expand Down

0 comments on commit 2008554

Please sign in to comment.