Nicer linebreaking in _render_log

This commit is contained in:
Florian Bruhin 2016-09-12 11:24:57 +02:00
parent 469c75662e
commit 38a3d118ab

View File

@ -80,9 +80,8 @@ def _render_log(data, threshold=100):
data = [str(d) for d in data]
is_exception = any('Traceback (most recent call last):' in line
for line in data)
if (len(data) > threshold and
not pytest.config.getoption('--verbose') and
not is_exception):
verbose = pytest.config.getoption('--verbose')
if len(data) > threshold and not verbose and not is_exception:
msg = '[{} lines suppressed, use -v to show]'.format(
len(data) - threshold)
data = [msg] + data[-threshold:]