Skip to content

#3203 Remove progress when no-capture #3263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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