9
9
pytest_plugins = "pytester"
10
10
11
11
12
- # result.stdout .no_fnmatch_line() is added to testdir on pytest 5.3.0
12
+ # result.stderr .no_fnmatch_line() is added to testdir on pytest 5.3.0
13
13
# https://docs.pytest.org/en/stable/changelog.html#pytest-5-3-0-2019-11-19
14
14
def no_fnmatch_line (result , pattern ):
15
15
if version .parse (pytest .__version__ ) >= version .parse ("5.3.0" ):
16
- result .stdout .no_fnmatch_line (pattern + "*" ,)
16
+ result .stderr .no_fnmatch_line (pattern + "*" ,)
17
17
else :
18
- assert pattern not in result .stdout .str ()
18
+ assert pattern not in result .stderr .str ()
19
19
20
20
21
21
def test_annotation_succeed_no_output (testdir ):
@@ -46,7 +46,7 @@ def test_fail():
46
46
)
47
47
testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
48
48
result = testdir .runpytest_subprocess ()
49
- result .stdout .fnmatch_lines (
49
+ result .stderr .fnmatch_lines (
50
50
["::error file=test_annotation_fail.py,line=5::test_fail*assert 0*" ,]
51
51
)
52
52
@@ -64,7 +64,7 @@ def test_fail():
64
64
)
65
65
testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
66
66
result = testdir .runpytest_subprocess ()
67
- result .stdout .fnmatch_lines (
67
+ result .stderr .fnmatch_lines (
68
68
["::error file=test_annotation_exception.py,line=5::test_fail*oops*" ,]
69
69
)
70
70
@@ -101,7 +101,7 @@ def test_fail():
101
101
testdir .mkdir ("foo" )
102
102
testdir .makefile (".ini" , pytest = "[pytest]\n testpaths=.." )
103
103
result = testdir .runpytest_subprocess ("--rootdir=foo" )
104
- result .stdout .fnmatch_lines (
104
+ result .stderr .fnmatch_lines (
105
105
["::error file=test_annotation_fail_cwd.py,line=5::test_fail*assert 0*" ,]
106
106
)
107
107
@@ -130,7 +130,7 @@ def test_fail():
130
130
)
131
131
testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
132
132
result = testdir .runpytest_subprocess ()
133
- result .stdout .fnmatch_lines (
133
+ result .stderr .fnmatch_lines (
134
134
[
135
135
"::error file=test_annotation_long.py,line=17::test_fail*assert 8 == 3*where 8 = f(8)*" ,
136
136
]
@@ -152,7 +152,7 @@ def test_method(self):
152
152
)
153
153
testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
154
154
result = testdir .runpytest_subprocess ()
155
- result .stdout .fnmatch_lines (
155
+ result .stderr .fnmatch_lines (
156
156
[
157
157
"::error file=test_class_method.py,line=7::TestClass.test_method*assert 1 == 2*" ,
158
158
]
@@ -178,7 +178,7 @@ def test_param(a, b):
178
178
)
179
179
testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
180
180
result = testdir .runpytest_subprocess ()
181
- result .stdout .fnmatch_lines (
181
+ result .stderr .fnmatch_lines (
182
182
[
183
183
"::error file=test_annotation_param.py,line=11::test_param?other?1*assert 2 == 3*" ,
184
184
]
0 commit comments