We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a474bd commit d697a12Copy full SHA for d697a12
tests/test_asyncio_mark_on_sync_function.py
@@ -1,8 +1,10 @@
1
from textwrap import dedent
2
3
+from pytest import Pytester
4
-def test_warn_asyncio_marker_for_regular_func(testdir):
5
- testdir.makepyfile(
+
6
+def test_warn_asyncio_marker_for_regular_func(pytester: Pytester):
7
+ pytester.makepyfile(
8
dedent(
9
"""\
10
import pytest
@@ -15,7 +17,7 @@ def test_a():
15
17
"""
16
18
)
19
- testdir.makefile(
20
+ pytester.makefile(
21
".ini",
22
pytest=dedent(
23
@@ -26,7 +28,7 @@ def test_a():
26
28
27
29
),
30
- result = testdir.runpytest()
31
+ result = pytester.runpytest()
32
result.assert_outcomes(passed=1)
33
result.stdout.fnmatch_lines(
34
["*is marked with '@pytest.mark.asyncio' but it is not an async function.*"]
0 commit comments