Skip to content

A caveat in using a custom clock fixture #157

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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