Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
longreprs aren't always tuples, apparently
Browse files Browse the repository at this point in the history
  • Loading branch information
seandst committed Jan 8, 2015
1 parent ea888e0 commit da4b934
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fixtures/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ def pytest_runtest_logreport(report):
_test_status(_format_nodeid(report.nodeid, False)))),
extra={'source_file': path, 'source_lineno': lineno})
if report.outcome == "skipped":
logger().info(log.format_marker(report.longrepr[-1]))
# Usualy longrepr's a tuple, other times it isn't... :(
try:
longrepr = report.longrepr[-1]
except AttributeError:
longrepr = str(report.longrepr)

logger().info(log.format_marker(longrepr))


def pytest_exception_interact(node, call, report):
Expand Down

0 comments on commit da4b934

Please sign in to comment.