You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_contextvarsimportContextVarimportpytestblah=ContextVar("blah")
@pytest.fixtureasyncdefmy_context_var():
blah.set("hello")
assertblah.get() =="hello"yieldblah@pytest.mark.asyncioasyncdeftest_blah(my_context_var):
assertmy_context_var.get() =="hello"# this fails
valeshino, kalefranz, potykion, DasIch, nikicat and 33 more