Skip to content

Commit a111b89

Browse files
committed
testing that this plugin does not work outside of GitHub Actions workflow
1 parent 3a7eedd commit a111b89

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

plugin_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,20 @@ def test_fail():
5252
result.stdout.fnmatch_lines([
5353
'::error file=test_annotation_exception.py,line=4::def test_fail():*',
5454
])
55+
56+
def test_annotation_fail_disabled_outside_workflow(testdir):
57+
testdir.makepyfile(
58+
'''
59+
import pytest
60+
pytest_plugins = 'pytest_github_actions_annotate_failures'
61+
62+
def test_fail():
63+
assert 0
64+
'''
65+
)
66+
testdir.monkeypatch.setenv('GITHUB_ACTIONS', '')
67+
testdir._method = 'subprocess'
68+
result = testdir.runpytest()
69+
result.stdout.no_fnmatch_line(
70+
'::error file=test_annotation_fail_disabled_outside_workflow.py*',
71+
)

0 commit comments

Comments
 (0)