File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
pytest_github_actions_annotate_failures Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ def test_fail():
119
119
testdir .monkeypatch .setenv ('GITHUB_ACTIONS' , 'true' )
120
120
result = testdir .runpytest_subprocess ()
121
121
result .stdout .fnmatch_lines ([
122
- '::error file=test_annotation_long.py,line=17::test_annotation_fail *assert 8 == 3*where 8 = f(8)*' ,
122
+ '::error file=test_annotation_long.py,line=17::test_fail *assert 8 == 3*where 8 = f(8)*' ,
123
123
])
124
124
no_fnmatch_line (result , '::*assert x += 1*' )
125
125
@@ -145,7 +145,7 @@ def test_method(self):
145
145
146
146
147
147
148
- def test_annotation_long (testdir ):
148
+ def test_annotation_param (testdir ):
149
149
testdir .makepyfile (
150
150
'''
151
151
import pytest
@@ -164,7 +164,7 @@ def test_param(a, b):
164
164
testdir .monkeypatch .setenv ('GITHUB_ACTIONS' , 'true' )
165
165
result = testdir .runpytest_subprocess ()
166
166
result .stdout .fnmatch_lines ([
167
- '::error file=test_annotation_long .py,line=11::test_param?other?1*assert 2 == 3*' ,
167
+ '::error file=test_annotation_param .py,line=11::test_param?other?1*assert 2 == 3*' ,
168
168
])
169
169
170
170
# Debugging / development tip:
Original file line number Diff line number Diff line change 3
3
import pytest
4
4
from collections import OrderedDict
5
5
6
+ # Reference:
7
+ # https://docs.pytest.org/en/latest/writing_plugins.html#hookwrapper-executing-around-other-hooks
8
+ # https://docs.pytest.org/en/latest/writing_plugins.html#hook-function-ordering-call-example
9
+ # https://docs.pytest.org/en/stable/reference.html#pytest.hookspec.pytest_runtest_makereport
10
+ #
11
+ # Inspired by:
12
+ # https://github.com/pytest-dev/pytest/blob/master/src/_pytest/terminal.py
13
+
6
14
@pytest .hookimpl (tryfirst = True , hookwrapper = True )
7
15
def pytest_runtest_makereport (item , call ):
8
16
# execute all other hooks to obtain the report object
You can’t perform that action at this time.
0 commit comments