Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ContextVar not propagated from fixture to test #127

Milestone
@beedub

Description

@beedub

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp