Open
Description
I'm trying to figure out why this code sample isn't working. I'm not experienced with asyncio yet, so this is very likely a simple misunderstanding on my part.
from _contextvars import ContextVar
import pytest
blah = ContextVar("blah")
@pytest.fixture
async def my_context_var():
blah.set("hello")
assert blah.get() == "hello"
yield blah
@pytest.mark.asyncio
async def test_blah(my_context_var):
assert my_context_var.get() == "hello" # this fails
Metadata
Metadata
Assignees
Labels
No labels