tests: Handle report.longrepr being a tuple.
For some unknown reason, report.longrepr.addsection might not exist, which caused failures on OS X and Windows. If that happens, we just don't add a section at all.
This commit is contained in:
parent
e6284ed5d4
commit
a157f822d6
@ -86,6 +86,11 @@ def pytest_runtest_makereport(item, call):
|
|||||||
quteproc_log = getattr(item, '_quteproc_log', None)
|
quteproc_log = getattr(item, '_quteproc_log', None)
|
||||||
httpbin_log = getattr(item, '_httpbin_log', None)
|
httpbin_log = getattr(item, '_httpbin_log', None)
|
||||||
|
|
||||||
|
if not hasattr(report.longrepr, 'addsection'):
|
||||||
|
# In some conditions (on OS X and Windows it seems), report.longrepr is
|
||||||
|
# actually a tuple. This is handled similarily in pytest-qt too.
|
||||||
|
return
|
||||||
|
|
||||||
if quteproc_log is not None:
|
if quteproc_log is not None:
|
||||||
report.longrepr.addsection("qutebrowser output",
|
report.longrepr.addsection("qutebrowser output",
|
||||||
'\n'.join(quteproc_log))
|
'\n'.join(quteproc_log))
|
||||||
|
Loading…
Reference in New Issue
Block a user