@@ -15,18 +15,7 @@ def test_a():
15
15
"""
16
16
)
17
17
)
18
- pytester .makefile (
19
- ".ini" ,
20
- pytest = dedent (
21
- """\
22
- [pytest]
23
- asyncio_mode = strict
24
- filterwarnings =
25
- default
26
- """
27
- ),
28
- )
29
- result = pytester .runpytest ()
18
+ result = pytester .runpytest ("--asyncio-mode=strict" , "-W default" )
30
19
result .assert_outcomes (passed = 1 )
31
20
result .stdout .fnmatch_lines (
32
21
["*is marked with '@pytest.mark.asyncio' but it is not an async function.*" ]
@@ -47,18 +36,7 @@ async def test_a():
47
36
"""
48
37
)
49
38
)
50
- pytester .makefile (
51
- ".ini" ,
52
- pytest = dedent (
53
- """\
54
- [pytest]
55
- asyncio_mode = strict
56
- filterwarnings =
57
- default
58
- """
59
- ),
60
- )
61
- result = pytester .runpytest ()
39
+ result = pytester .runpytest ("--asyncio-mode=strict" , "-W default" )
62
40
result .assert_outcomes (xfailed = 1 , warnings = 1 )
63
41
result .stdout .fnmatch_lines (
64
42
["*Tests based on asynchronous generators are not supported*" ]
@@ -76,18 +54,7 @@ async def test_a():
76
54
"""
77
55
)
78
56
)
79
- pytester .makefile (
80
- ".ini" ,
81
- pytest = dedent (
82
- """\
83
- [pytest]
84
- asyncio_mode = auto
85
- filterwarnings =
86
- default
87
- """
88
- ),
89
- )
90
- result = pytester .runpytest ()
57
+ result = pytester .runpytest ("--asyncio-mode=auto" , "-W default" )
91
58
result .assert_outcomes (xfailed = 1 , warnings = 1 )
92
59
result .stdout .fnmatch_lines (
93
60
["*Tests based on asynchronous generators are not supported*" ]
@@ -109,18 +76,7 @@ async def test_a(self):
109
76
"""
110
77
)
111
78
)
112
- pytester .makefile (
113
- ".ini" ,
114
- pytest = dedent (
115
- """\
116
- [pytest]
117
- asyncio_mode = strict
118
- filterwarnings =
119
- default
120
- """
121
- ),
122
- )
123
- result = pytester .runpytest ()
79
+ result = pytester .runpytest ("--asyncio-mode=strict" , "-W default" )
124
80
result .assert_outcomes (xfailed = 1 , warnings = 1 )
125
81
result .stdout .fnmatch_lines (
126
82
["*Tests based on asynchronous generators are not supported*" ]
@@ -140,18 +96,7 @@ async def test_a():
140
96
"""
141
97
)
142
98
)
143
- pytester .makefile (
144
- ".ini" ,
145
- pytest = dedent (
146
- """\
147
- [pytest]
148
- asyncio_mode = auto
149
- filterwarnings =
150
- default
151
- """
152
- ),
153
- )
154
- result = pytester .runpytest ()
99
+ result = pytester .runpytest ("--asyncio-mode=auto" , "-W default" )
155
100
result .assert_outcomes (xfailed = 1 , warnings = 1 )
156
101
result .stdout .fnmatch_lines (
157
102
["*Tests based on asynchronous generators are not supported*" ]
@@ -174,18 +119,7 @@ async def test_a():
174
119
"""
175
120
)
176
121
)
177
- pytester .makefile (
178
- ".ini" ,
179
- pytest = dedent (
180
- """\
181
- [pytest]
182
- asyncio_mode = strict
183
- filterwarnings =
184
- default
185
- """
186
- ),
187
- )
188
- result = pytester .runpytest ()
122
+ result = pytester .runpytest ("--asyncio-mode=strict" , "-W default" )
189
123
result .assert_outcomes (xfailed = 1 , warnings = 1 )
190
124
result .stdout .fnmatch_lines (
191
125
["*Tests based on asynchronous generators are not supported*" ]
@@ -205,18 +139,7 @@ async def test_a():
205
139
"""
206
140
)
207
141
)
208
- pytester .makefile (
209
- ".ini" ,
210
- pytest = dedent (
211
- """\
212
- [pytest]
213
- asyncio_mode = auto
214
- filterwarnings =
215
- default
216
- """
217
- ),
218
- )
219
- result = pytester .runpytest ()
142
+ result = pytester .runpytest ("--asyncio-mode=auto" , "-W default" )
220
143
result .assert_outcomes (xfailed = 1 , warnings = 1 )
221
144
result .stdout .fnmatch_lines (
222
145
["*Tests based on asynchronous generators are not supported*" ]
0 commit comments