Merge pull request #3263 from feuillemorte/3203-remove-statistic-indicator

#3203 Remove progress when no-capture
This commit is contained in:
Bruno Oliveira 2018-02-27 07:33:45 -03:00 committed by GitHub
commit 20085542e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -324,6 +324,8 @@ class TerminalReporter(object):
_PROGRESS_LENGTH = len(' [100%]') _PROGRESS_LENGTH = len(' [100%]')
def _get_progress_information_message(self): def _get_progress_information_message(self):
if self.config.getoption('capture') == 'no':
return ''
collected = self._session.testscollected collected = self._session.testscollected
if collected: if collected:
progress = len(self._progress_nodeids_reported) * 100 // collected progress = len(self._progress_nodeids_reported) * 100 // collected

View File

@ -0,0 +1 @@
Removed progress information when capture option is ``no``.

View File

@ -1046,6 +1046,9 @@ class TestProgress(object):
r'test_foobar.py \.{5}', r'test_foobar.py \.{5}',
]) ])
output = testdir.runpytest('--capture=no')
assert "%]" not in output.stdout.str()
class TestProgressWithTeardown(object): class TestProgressWithTeardown(object):
"""Ensure we show the correct percentages for tests that fail during teardown (#3088)""" """Ensure we show the correct percentages for tests that fail during teardown (#3088)"""