Skip to content

Commit 74a4dfe

Browse files
Rename option to --exclude-warning-annotations
1 parent 93411ab commit 74a4dfe

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

+4
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def test_warning():
139139
"""
140140
)
141141
testdir.monkeypatch.setenv("GITHUB_ACTIONS", "true")
142-
result = testdir.runpytest_subprocess("--exclude-warnings")
142+
result = testdir.runpytest_subprocess("--exclude-warning-annotations")
143143
assert not result.stderr.lines
144144

145145

pytest_github_actions_annotate_failures/plugin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ def pytest_warning_recorded(self, warning_message, when, nodeid, location): # n
127127
def pytest_addoption(parser):
128128
group = parser.getgroup("pytest_github_actions_annotate_failures")
129129
group.addoption(
130-
"--exclude-warnings",
130+
"--exclude-warning-annotations",
131131
action="store_true",
132132
default=False,
133133
help="Annotate failures in GitHub Actions.",
134134
)
135135

136136
def pytest_configure(config):
137-
if not config.option.exclude_warnings:
137+
if not config.option.exclude_warning_annotations:
138138
config.pluginmanager.register(_AnnotateWarnings(), "annotate_warnings")
139139

140140

0 commit comments

Comments
 (0)