Skip to content

async generators pytest fixtures #41

Closed
@sashgorokhov

Description

@sashgorokhov

Python 3.6 have introduced new async generator entity:

async def foo():
    yield 'Foo'

When trying to create yield fixture in pytest (or a simple fixture but with async def) and decorate it with @pytest.mark.asyncio i receive a coroutine instead of fixture result.

Is there a way to make pytest.mark.asyncio recognize fixtures as coroutine functions or async generator functions and behave properly on them?

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