tests: Improve matching of exceptions to show verbose output

In some situations we can get a TypeError without a stack
This commit is contained in:
Florian Bruhin 2017-05-11 07:34:52 +02:00
parent f6fc2666ce
commit 3f8b9fb1a5

View File

@ -79,7 +79,7 @@ def _render_log(data, threshold=100):
"""Shorten the given log without -v and convert to a string."""
data = [str(d) for d in data]
is_exception = any('Traceback (most recent call last):' in line
for line in data)
or 'Uncaught exception' in line for line in data)
verbose = pytest.config.getoption('--verbose')
if len(data) > threshold and not verbose and not is_exception:
msg = '[{} lines suppressed, use -v to show]'.format(