You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Give a better error when users make an async fixture non-function-scoped, or use it with a sync test #51
It would be nice if when Trio mode was activated, this gave an error:
@pytest.fixtureasyncdefmy_async_fixture():
...
# Notice: not an async testdeftest_something(my_async_fixture):
...
Obviously we can't do this when trio mode isn't activated, because someone else might be handling the fixture. But when it is, we could give a nice error in theory.
The blocker is that I'm not sure how we're supposed to check the pytest configuration from pytest_fixture_setup...
Also, it would also be nice if we could make it so when Trio mode is activated, this gives an error:
This is tricky because if someone does do this, then from pytest_setup_fixture's point of view, it actually won't detect that this fixture should be treated as a trio fixture, because for a session fixture we can't see which tests it will ultimately be used with (and detect that they have @pytest.mark.trio). So this actually ends up being similar to the above case.
(Unless there's some way to ask pytest for a list of all the items that a session-scoped fixture will ultimately be used for, but I don't know of one.)
Activity
In Trio mode, auto-convert async fixtures to Trio fixtures
In Trio mode, auto-convert async fixtures to Trio fixtures