Skip to content

A caveat in using a custom clock fixture #157

@fjarri

Description

@fjarri

Something that's not currently documented and took me some time to figure out: https://pytest-trio.readthedocs.io/en/stable/reference.html#mock_clock should mention that the custom fixture must be a normal fixture and not a pytest-trio one (which can easily happen if you make the fixture async def, for whatever reason). Which, of course, makes sense — you can't pass a clock to trio when you're already in the event loop — but it's a mistake that's easy to make, and that can go unnoticed for a while.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions