Skip to content

Commit 7166e0b

Browse files
authored
Merge pull request #47 from Tenzer/handle-test-failures-without-linenumber
Handle test failures without a line number
2 parents 6cb5788 + 91f29c9 commit 7166e0b

File tree

1 file changed

+3
-2
lines changed
  • pytest_github_actions_annotate_failures

1 file changed

+3
-2
lines changed

pytest_github_actions_annotate_failures/plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ def pytest_runtest_makereport(item, call):
4949
if not rel_path.startswith(".."):
5050
filesystempath = rel_path
5151

52-
# 0-index to 1-index
53-
lineno += 1
52+
if lineno is not None:
53+
# 0-index to 1-index
54+
lineno += 1
5455

5556
# get the name of the current failed test, with parametrize info
5657
longrepr = report.head_line or item.name

0 commit comments

Comments
 (0)