Restructure pytest plugin hooks#91
Conversation
At the moment I do not recall why, but for consistency...
|
@cdunklau, I haven't made it all the way through my basic self-review let alone a reconsideration of where these changes evolved too... but I think this is may be worth looking at at this point and trying out. I'm thinking that it might be worth testing non-function scope fixtures as well. Should be easy enough with a fixture that yields |
pytest_twisted.py
Outdated
| def pytest_fixture_setup(fixturedef, request): | ||
| """Interface pytest to async setup for async and async yield fixtures.""" | ||
| # TODO: what about inlineCallbacks fixtures? | ||
| maybe_mark = getattr(fixturedef.func, _mark_attribute_name, None) |
There was a problem hiding this comment.
Maybe I'm not following the code exactly, but the maybeDeferred in in_reactor later on should handle that, I think? (referring to the "TODO" comment)
There was a problem hiding this comment.
And this is why I need these todo's so I come back and get a clue... :| I was thinking there were inlineCallbacks fixtures and they ought to be handled here too. There aren't. *smh* and such. Thanks.
Though, seems like they could be implemented (after 30 seconds of thought anyways). Add a decorator to mark them and intercept them here for setup before pytest gets confused by them.
|
Hi @vtitor and @schmir. After doing this PR I am starting to feel like I actually have some grasp on how pytest-twisted works overall but it is only reasonable to assume there is still plenty of history and reasons that I still don't know (or straight up errors I've made as well...). If you have time I would appreciate any feedback on these changes, even if just some quick questions or such about something that looks fishy. If not, no worries. I get it being busy with other things. |
|
Sorry, but I don't have time to look into this. |
|
To have it in the record here: pytest-dev/pytest#3261 (comment) |
These changes enable handling of nested async fixtures and non-function scope async fixtures.
WIP for:
Matching fixture teardown order