Skip to content

Commit

Permalink
Rename option to --exclude-warning-annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed May 17, 2023
1 parent a817e38 commit 5d4405e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,9 @@ If your test is running in a Docker container, you have to install this plugin a

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.

### Warning annotations

This plugin also supports warning annotations when used with Pytest 6.0+. To disable warning annotations, pass `--exclude-warning-annotations` to pytest.

## Screenshot
[![Image from Gyazo](https://i.gyazo.com/b578304465dd1b755ceb0e04692a57d9.png)](https://gyazo.com/b578304465dd1b755ceb0e04692a57d9)
2 changes: 1 addition & 1 deletion plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_warning():
"""
)
testdir.monkeypatch.setenv("GITHUB_ACTIONS", "true")
result = testdir.runpytest_subprocess("--exclude-warnings")
result = testdir.runpytest_subprocess("--exclude-warning-annotations")
assert not result.stderr.lines


Expand Down
4 changes: 2 additions & 2 deletions pytest_github_actions_annotate_failures/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ def pytest_warning_recorded(self, warning_message, when, nodeid, location): # n
def pytest_addoption(parser):
group = parser.getgroup("pytest_github_actions_annotate_failures")
group.addoption(
"--exclude-warnings",
"--exclude-warning-annotations",
action="store_true",
default=False,
help="Annotate failures in GitHub Actions.",
)

def pytest_configure(config):
if not config.option.exclude_warnings:
if not config.option.exclude_warning_annotations:
config.pluginmanager.register(_AnnotateWarnings(), "annotate_warnings")


Expand Down

0 comments on commit 5d4405e

Please sign in to comment.