Skip to content

Commit

Permalink
Ugly quickfix for broken tracebacks
Browse files Browse the repository at this point in the history
  • Loading branch information
freider committed Nov 28, 2024
1 parent 2e5427b commit 3693fb8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pytest_markdown_docs/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def repr_failure(
True # start capturing frames the first time we enter user code
)
line = (
rawlines[frame_summary.lineno - 1] if frame_summary.lineno else ""
rawlines[frame_summary.lineno - 1]
if 1 <= frame_summary.lineno <= len(rawlines)
else ""
)
else:
lineno = frame_summary.lineno or 0
Expand Down

0 comments on commit 3693fb8

Please sign in to comment.