Use classic console output when -s is used

Fixes #3038
This commit is contained in:
Segev Finer 2017-12-16 14:52:30 +02:00
parent db4df5833a
commit 370daf0441
3 changed files with 11 additions and 1 deletions

View File

@ -153,7 +153,8 @@ class TerminalReporter:
self.hasmarkup = self._tw.hasmarkup
self.isatty = file.isatty()
self._progress_items_reported = 0
self._show_progress_info = self.config.getini('console_output_style') == 'progress'
self._show_progress_info = (self.config.getoption('capture') != 'no' and
self.config.getini('console_output_style') == 'progress')
def hasopt(self, char):
char = {'xfailed': 'x', 'skipped': 's'}.get(char, char)

1
changelog/3038.feature Normal file
View File

@ -0,0 +1 @@
Use classic console output when -s is used.

View File

@ -1037,3 +1037,11 @@ class TestProgress:
r'\[gw\d\] \[\s*\d+%\] PASSED test_foo.py::test_foo\[1\]',
r'\[gw\d\] \[\s*\d+%\] PASSED test_foobar.py::test_foobar\[1\]',
])
def test_capture_no(self, many_tests_file, testdir):
output = testdir.runpytest('-s')
output.stdout.re_match_lines([
r'test_bar.py \.{10}',
r'test_foo.py \.{5}',
r'test_foobar.py \.{5}',
])