99pytest_plugins = "pytester"
1010
1111
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
1313# https://docs.pytest.org/en/stable/changelog.html#pytest-5-3-0-2019-11-19
1414def no_fnmatch_line (result , pattern ):
1515 if version .parse (pytest .__version__ ) >= version .parse ("5.3.0" ):
16- result .stdout .no_fnmatch_line (pattern + "*" ,)
16+ result .stderr .no_fnmatch_line (pattern + "*" ,)
1717 else :
18- assert pattern not in result .stdout .str ()
18+ assert pattern not in result .stderr .str ()
1919
2020
2121def test_annotation_succeed_no_output (testdir ):
@@ -46,7 +46,7 @@ def test_fail():
4646 )
4747 testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
4848 result = testdir .runpytest_subprocess ()
49- result .stdout .fnmatch_lines (
49+ result .stderr .fnmatch_lines (
5050 ["::error file=test_annotation_fail.py,line=5::test_fail*assert 0*" ,]
5151 )
5252
@@ -64,7 +64,7 @@ def test_fail():
6464 )
6565 testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
6666 result = testdir .runpytest_subprocess ()
67- result .stdout .fnmatch_lines (
67+ result .stderr .fnmatch_lines (
6868 ["::error file=test_annotation_exception.py,line=5::test_fail*oops*" ,]
6969 )
7070
@@ -101,7 +101,7 @@ def test_fail():
101101 testdir .mkdir ("foo" )
102102 testdir .makefile (".ini" , pytest = "[pytest]\n testpaths=.." )
103103 result = testdir .runpytest_subprocess ("--rootdir=foo" )
104- result .stdout .fnmatch_lines (
104+ result .stderr .fnmatch_lines (
105105 ["::error file=test_annotation_fail_cwd.py,line=5::test_fail*assert 0*" ,]
106106 )
107107
@@ -130,7 +130,7 @@ def test_fail():
130130 )
131131 testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
132132 result = testdir .runpytest_subprocess ()
133- result .stdout .fnmatch_lines (
133+ result .stderr .fnmatch_lines (
134134 [
135135 "::error file=test_annotation_long.py,line=17::test_fail*assert 8 == 3*where 8 = f(8)*" ,
136136 ]
@@ -152,7 +152,7 @@ def test_method(self):
152152 )
153153 testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
154154 result = testdir .runpytest_subprocess ()
155- result .stdout .fnmatch_lines (
155+ result .stderr .fnmatch_lines (
156156 [
157157 "::error file=test_class_method.py,line=7::TestClass.test_method*assert 1 == 2*" ,
158158 ]
@@ -178,7 +178,7 @@ def test_param(a, b):
178178 )
179179 testdir .monkeypatch .setenv ("GITHUB_ACTIONS" , "true" )
180180 result = testdir .runpytest_subprocess ()
181- result .stdout .fnmatch_lines (
181+ result .stderr .fnmatch_lines (
182182 [
183183 "::error file=test_annotation_param.py,line=11::test_param?other?1*assert 2 == 3*" ,
184184 ]
0 commit comments