File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ pytest_plugins = 'pytester'
2
+ import pytest
3
+
4
+ def test_annotation_fail (testdir ):
5
+ testdir .makepyfile (
6
+ '''
7
+ import pytest
8
+ pytest_plugins = 'pytest_github_actions_annotate_failures'
9
+
10
+ def test_fail():
11
+ assert 0
12
+ '''
13
+ )
14
+ result = testdir .runpytest ()
15
+ result .stdout .fnmatch_lines ([
16
+ '::error file=test_annotation_fail.py,line=4::def test_fail():%0A*' ,
17
+ ])
18
+
19
+ def test_annotation_exception (testdir ):
20
+ testdir .makepyfile (
21
+ '''
22
+ import pytest
23
+ pytest_plugins = 'pytest_github_actions_annotate_failures'
24
+
25
+ def test_fail():
26
+ raise Exception('oops')
27
+ assert 1
28
+ '''
29
+ )
30
+ result = testdir .runpytest ()
31
+ result .stdout .fnmatch_lines ([
32
+ '::error file=test_annotation_exception.py,line=4::def test_fail():%0A*' ,
33
+ ])
You can’t perform that action at this time.
0 commit comments