Skip to content

Commit 079e5f9

Browse files
authored
Merge pull request #40 from billyvg/master
Ignore failures that are retried using `pytest-rerunfailures` plugin
2 parents 7e1ec1f + b2516c5 commit 079e5f9

File tree

1 file changed

+9
-0
lines changed
  • pytest_github_actions_annotate_failures

1 file changed

+9
-0
lines changed

pytest_github_actions_annotate_failures/plugin.py

+9
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ def pytest_runtest_makereport(item, call):
2727
if os.environ.get("GITHUB_ACTIONS") != "true":
2828
return
2929

30+
try:
31+
# If we have the pytest_rerunfailures plugin, and there are still
32+
# retries to be run, then ignore error
33+
import pytest_rerunfailures
34+
if item.execution_count <= pytest_rerunfailures.get_reruns_count(item):
35+
return
36+
except ImportError:
37+
pass
38+
3039
if report.when == "call" and report.failed:
3140
# collect information to be annotated
3241
filesystempath, lineno, _ = report.location

0 commit comments

Comments
 (0)