@@ -33,27 +33,34 @@ async def no_var_fixture():
3333
3434
3535@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 " ):
3838 yield
3939
4040
4141@pytest .fixture (scope = "function" )
42- async def var_nop_fixture (var_fixture ):
42+ async def var_nop_fixture (var_fixture_1 ):
4343 with context_var_manager (_context_var .get ()):
4444 yield
4545
4646
4747@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 "
5050 with context_var_manager ("value2" ):
5151 yield
5252
5353
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+
5461@pytest .mark .asyncio
5562@pytest .mark .xfail (
5663 sys .version_info < (3 , 11 ), reason = "requires asyncio Task context support"
5764)
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