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
I'm sure this is a side-effect of the trio-fixture workaround approach explained in the docs, but it still might be possible to find those fixtures and make them work. If not, I think this rub is at least worth specifically mentioning in the docs.
The text was updated successfully, but these errors were encountered:
mikenerone
changed the title
Async fixture do not support autouse=True
Async fixture do not support autouse=TrueSep 7, 2021
mikenerone
changed the title
Async fixture do not support autouse=True
Async fixtures do not support autouse=TrueSep 7, 2021
I think the issue is that when we scan through to find and run all the trio fixtures, we do that by scanning over the test's kwargs, and I guess autouse fixtures don't show up in kwargs? The relevant code is in plugin.py, _trio_test_runner_factory which delegates to register_and_collect_dependencies. It's probably easy to fix -- we just need to figure out some way to query pytest for the full list of fixtures, not just the ones that get passed into the test function. Likely it's stashed on the item object somewhere? That's this magical pytest thing that has all kinds of undocumented attributes on it.
Async fixtures defined with
autouse
aren't automatically used. E.g.I'm sure this is a side-effect of the trio-fixture workaround approach explained in the docs, but it still might be possible to find those fixtures and make them work. If not, I think this rub is at least worth specifically mentioning in the docs.
The text was updated successfully, but these errors were encountered: