@@ -33,27 +33,34 @@ async def no_var_fixture():
33
33
34
34
35
35
@pytest .fixture (scope = "function" )
36
- async def var_fixture (no_var_fixture ):
37
- with context_var_manager ("value " ):
36
+ async def var_fixture_1 (no_var_fixture ):
37
+ with context_var_manager ("value1 " ):
38
38
yield
39
39
40
40
41
41
@pytest .fixture (scope = "function" )
42
- async def var_nop_fixture (var_fixture ):
42
+ async def var_nop_fixture (var_fixture_1 ):
43
43
with context_var_manager (_context_var .get ()):
44
44
yield
45
45
46
46
47
47
@pytest .fixture (scope = "function" )
48
- def inner_var_fixture (var_nop_fixture ):
49
- assert _context_var .get () == "value "
48
+ def var_fixture_2 (var_nop_fixture ):
49
+ assert _context_var .get () == "value1 "
50
50
with context_var_manager ("value2" ):
51
51
yield
52
52
53
53
54
+ @pytest .fixture (scope = "function" )
55
+ async def var_fixture_3 (var_fixture_2 ):
56
+ assert _context_var .get () == "value2"
57
+ with context_var_manager ("value3" ):
58
+ yield
59
+
60
+
54
61
@pytest .mark .asyncio
55
62
@pytest .mark .xfail (
56
63
sys .version_info < (3 , 11 ), reason = "requires asyncio Task context support"
57
64
)
58
- async def test (inner_var_fixture ):
59
- assert _context_var .get () == "value2 "
65
+ async def test (var_fixture_3 ):
66
+ assert _context_var .get () == "value3 "
0 commit comments