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:
parent
f6fc2666ce
commit
3f8b9fb1a5
@ -79,7 +79,7 @@ def _render_log(data, threshold=100):
|
|||||||
"""Shorten the given log without -v and convert to a string."""
|
"""Shorten the given log without -v and convert to a string."""
|
||||||
data = [str(d) for d in data]
|
data = [str(d) for d in data]
|
||||||
is_exception = any('Traceback (most recent call last):' in line
|
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')
|
verbose = pytest.config.getoption('--verbose')
|
||||||
if len(data) > threshold and not verbose and not is_exception:
|
if len(data) > threshold and not verbose and not is_exception:
|
||||||
msg = '[{} lines suppressed, use -v to show]'.format(
|
msg = '[{} lines suppressed, use -v to show]'.format(
|
||||||
|
Loading…
Reference in New Issue
Block a user