File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1
1
pytest_plugins = 'pytester'
2
2
import pytest
3
+ import os
3
4
from packaging import version
4
5
5
6
# result.stdout.no_fnmatch_line() is added to testdir on pytest 5.3.0
@@ -73,3 +74,21 @@ def test_fail():
73
74
testdir .monkeypatch .setenv ('GITHUB_ACTIONS' , '' )
74
75
result = testdir .runpytest_subprocess ()
75
76
no_fnmatch_line (result , '::error file=test_annotation_fail_disabled_outside_workflow.py' )
77
+
78
+ def test_annotation_fail_cwd (testdir ):
79
+ testdir .makepyfile (
80
+ '''
81
+ import pytest
82
+ pytest_plugins = 'pytest_github_actions_annotate_failures'
83
+
84
+ def test_fail():
85
+ assert 0
86
+ '''
87
+ )
88
+ testdir .monkeypatch .setenv ('GITHUB_ACTIONS' , 'true' )
89
+ testdir .mkdir ('foo' )
90
+ testdir .makefile ('.ini' , pytest = '[pytest]\n testpaths=..' )
91
+ result = testdir .runpytest_subprocess ('--rootdir=foo' )
92
+ result .stdout .fnmatch_lines ([
93
+ '::error file=test_annotation_fail_cwd.py,line=4::def test_fail():*' ,
94
+ ])
You can’t perform that action at this time.
0 commit comments