Skip to content

Commit 494dca7

Browse files
Rename option to --exclude-warning-annotations
1 parent d0bb451 commit 494dca7

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
@@ -140,7 +140,7 @@ def test_warning():
140140
"""
141141
)
142142
testdir.monkeypatch.setenv("GITHUB_ACTIONS", "true")
143-
result = testdir.runpytest_subprocess("--exclude-warnings")
143+
result = testdir.runpytest_subprocess("--exclude-warning-annotations")
144144
assert not result.stderr.lines
145145

146146

pytest_github_actions_annotate_failures/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ def pytest_warning_recorded(self, warning_message, when, nodeid, location):
130130
def pytest_addoption(parser):
131131
group = parser.getgroup("pytest_github_actions_annotate_failures")
132132
group.addoption(
133-
"--exclude-warnings",
133+
"--exclude-warning-annotations",
134134
action="store_true",
135135
default=False,
136136
help="Annotate failures in GitHub Actions.",
137137
)
138138

139139
def pytest_configure(config):
140-
if not config.option.exclude_warnings:
140+
if not config.option.exclude_warning_annotations:
141141
config.pluginmanager.register(_AnnotateWarnings(), "annotate_warnings")
142142

143143

0 commit comments

Comments
 (0)