Skip to content

Use contextvars for the nursery fixture #54

@touilleMan

Description

@touilleMan

Right now the nursery fixture is implemented in a pretty hacky way by patching the item object given by pytest:

@pytest.fixture
async def nursery(request):
return request.node._trio_nursery

I wonder if it wouldn't be better to use the contextvars feature now that it is availble (even in older version of python thanks to Yury's backport https://github.com/MagicStack/contextvars)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions