Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Trio Mode through import * doesn't work when using same pytest hooks #141

Open
jordanlibrande opened this issue Jan 22, 2024 · 0 comments

Comments

@jordanlibrande
Copy link

from pytest_trio.enable_trio_mode import * doesn't work properly if your conftest.py itself implements pytest_collection_modifyitems or pytest_fixture_setup hooks. It seems the hooks from pytest_trio get shadowed by your local function so the pytest_trio hooks no longer get found and called by pytest.

Maybe at least add this behavior (and a recommended workaround) to the documentation?

I unblocked by having my local hooks call the pytest_trio versions of these hooks internally. (Possibly pytest hookwrapper could also be used?)

Probably better would be to have pytest_trio's pytest_collection_modifyitems and pytest_fixture_setup be in the main pytest_trio plugin, and have their behavior be configurable? Then I think they'll always be collected by pytest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant