Skip to content

Commit

Permalink
allow more errors when finding error line
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Mar 21, 2023
1 parent c63e606 commit 2ba6953
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pytest_pretty/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ def short_test_summary(self) -> None:
file, function_line, func = report.location
try:
repr_entries = report.longrepr.chain[-1][0].reprentries
error_line = str(repr_entries[0].reprfileloc.lineno)
error = repr_entries[-1].reprfileloc.message
except AttributeError:
error_line = ''
error = ''
else:
error_line = str(repr_entries[0].reprfileloc.lineno)
error = repr_entries[-1].reprfileloc.message

table.add_row(
escape(file),
escape(func),
Expand Down

0 comments on commit 2ba6953

Please sign in to comment.