File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
6
6
def test_strict_mode_cmdline (pytester : Pytester ):
7
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
7
8
pytester .makepyfile (
8
9
dedent (
9
10
"""\
@@ -23,6 +24,15 @@ async def test_a():
23
24
24
25
25
26
def test_strict_mode_cfg (pytester : Pytester ):
27
+ pytester .makeini (
28
+ dedent (
29
+ """\
30
+ [pytest]
31
+ asyncio_default_fixture_loop_scope = function
32
+ asyncio_mode = strict
33
+ """
34
+ )
35
+ )
26
36
pytester .makepyfile (
27
37
dedent (
28
38
"""\
@@ -37,12 +47,12 @@ async def test_a():
37
47
"""
38
48
)
39
49
)
40
- pytester .makefile (".ini" , pytest = "[pytest]\n asyncio_mode = strict\n " )
41
50
result = pytester .runpytest ()
42
51
result .assert_outcomes (passed = 1 )
43
52
44
53
45
54
def test_strict_mode_method_fixture (pytester : Pytester ):
55
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
46
56
pytester .makepyfile (
47
57
dedent (
48
58
"""\
@@ -71,6 +81,7 @@ async def test_a(self, fixture_a):
71
81
72
82
73
83
def test_strict_mode_ignores_unmarked_coroutine (pytester : Pytester ):
84
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
74
85
pytester .makepyfile (
75
86
dedent (
76
87
"""\
@@ -87,6 +98,7 @@ async def test_anything():
87
98
88
99
89
100
def test_strict_mode_ignores_unmarked_fixture (pytester : Pytester ):
101
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
90
102
pytester .makepyfile (
91
103
dedent (
92
104
"""\
You can’t perform that action at this time.
0 commit comments