2
2
3
3
from textwrap import dedent
4
4
5
- from pytest import Pytester
5
+ from pytest import Pytester , version_tuple as pytest_version
6
6
7
7
8
8
def test_strict_mode_cmdline (pytester : Pytester ):
@@ -95,7 +95,10 @@ async def test_anything():
95
95
)
96
96
)
97
97
result = pytester .runpytest_subprocess ("--asyncio-mode=strict" , "-W default" )
98
- result .assert_outcomes (skipped = 1 , warnings = 1 )
98
+ if pytest_version >= (8 , 4 , 0 ):
99
+ result .assert_outcomes (failed = 1 , skipped = 0 , warnings = 0 )
100
+ else :
101
+ result .assert_outcomes (skipped = 1 , warnings = 1 )
99
102
result .stdout .fnmatch_lines (["*async def functions are not natively supported*" ])
100
103
101
104
@@ -117,7 +120,11 @@ async def test_anything(any_fixture):
117
120
)
118
121
)
119
122
result = pytester .runpytest_subprocess ("--asyncio-mode=strict" , "-W default" )
120
- result .assert_outcomes (skipped = 1 , warnings = 2 )
123
+
124
+ if pytest_version >= (8 , 4 , 0 ):
125
+ result .assert_outcomes (failed = 1 , skipped = 0 , warnings = 2 )
126
+ else :
127
+ result .assert_outcomes (skipped = 1 , warnings = 2 )
121
128
result .stdout .fnmatch_lines (
122
129
[
123
130
"*async def functions are not natively supported*" ,
@@ -149,7 +156,10 @@ async def test_anything(any_fixture):
149
156
)
150
157
)
151
158
result = pytester .runpytest_subprocess ("--asyncio-mode=strict" , "-W default" )
152
- result .assert_outcomes (passed = 1 , failed = 0 , skipped = 0 , warnings = 1 )
159
+ if pytest_version >= (8 , 4 , 0 ):
160
+ result .assert_outcomes (passed = 1 , failed = 0 , skipped = 0 , warnings = 2 )
161
+ else :
162
+ result .assert_outcomes (passed = 1 , failed = 0 , skipped = 0 , warnings = 1 )
153
163
result .stdout .fnmatch_lines (
154
164
[
155
165
"*warnings summary*" ,
@@ -193,7 +203,10 @@ async def test_anything(any_fixture):
193
203
)
194
204
)
195
205
result = pytester .runpytest_subprocess ("--asyncio-mode=strict" , "-W default" )
196
- result .assert_outcomes (passed = 1 , warnings = 1 )
206
+ if pytest_version >= (8 , 4 , 0 ):
207
+ result .assert_outcomes (passed = 1 , warnings = 2 )
208
+ else :
209
+ result .assert_outcomes (passed = 1 , warnings = 1 )
197
210
result .stdout .fnmatch_lines (
198
211
[
199
212
"*warnings summary*" ,
0 commit comments