pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

Async steps

Open maafy6 opened this issue 2 years ago • 0 comments
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_async is 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_loop fixture if enabled/available).

maafy6 avatar Apr 15 '23 19:04 maafy6