pytest-bdd
pytest-bdd copied to clipboard
Async steps
trafficstars
Another start at #223. It seems as though some of the previous cracks at it have stalled, and with there being some significant changes to the baseline overall since those were opened (notably implementing steps as fixtures), I don't think those look too salvageable in their current form. This provides wrappers for step functions when declared as async, the wrapping logic is pretty closely based on what pytest-asyncio does for their @async_fixture (but this does not add pytest-asyncio as a requirement).
Things that might want to be considered:
- [ ] Strict mode - if
is_asyncis set, then raise an error if the function is not async. - [ ] Optional interop with other plugins (e.g. pytest-asyncio, could just request the
event_loopfixture if enabled/available).