Skip to content

Commit 051f7d4

Browse files
Rename option to --exclude-warning-annotations
1 parent 636b4b2 commit 051f7d4

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,9 @@ If your test is running in a Docker container, you have to install this plugin a
3636

3737
If your tests are run from a subdirectory of the git repository, you have to set the `PYTEST_RUN_PATH` environment variable to the path of that directory relative to the repository root in order for GitHub to identify the files with errors correctly.
3838

39+
### Warning annotations
40+
41+
This plugin also supports warning annotations when used with Pytest 6.0+. To disable warning annotations, pass `--exclude-warning-annotations` to pytest.
42+
3943
## Screenshot
4044
[![Image from Gyazo](https://i.gyazo.com/b578304465dd1b755ceb0e04692a57d9.png)](https://gyazo.com/b578304465dd1b755ceb0e04692a57d9)

plugin_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_warning():
126126
"""
127127
)
128128
testdir.monkeypatch.setenv("GITHUB_ACTIONS", "true")
129-
result = testdir.runpytest_subprocess("--exclude-warnings")
129+
result = testdir.runpytest_subprocess("--exclude-warning-annotations")
130130
assert not result.stderr.lines
131131

132132

pytest_github_actions_annotate_failures/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ def pytest_warning_recorded(self, warning_message, when, nodeid, location): # n
125125
def pytest_addoption(parser):
126126
group = parser.getgroup("pytest_github_actions_annotate_failures")
127127
group.addoption(
128-
"--exclude-warnings",
128+
"--exclude-warning-annotations",
129129
action="store_true",
130130
default=False,
131131
help="Annotate failures in GitHub Actions.",
132132
)
133133

134134
def pytest_configure(config):
135-
if not config.option.exclude_warnings:
135+
if not config.option.exclude_warning_annotations:
136136
config.pluginmanager.register(_AnnotateWarnings(), "annotate_warnings")
137137

138138

0 commit comments

Comments
 (0)