pytest-dev / pytest-bdd

BDD library for the pytest runner
https://pytest-bdd.readthedocs.io/en/latest/
MIT License
1.31k stars 221 forks source link

Async when & then #553

Closed j4k0bk closed 2 years ago

j4k0bk commented 2 years ago

I am implementing an end-to-end integration test suite using pytest-bdd. I need to execute multiple @when and @then asynchronously.

For instance, one @when might be moving a stepper motor, while another @when performs another real-time process (like playing a sound through a speaker). At the same, a @then is streaming feed from a camera and doing some image analysis on the motor's movement, while another @then is streaming from a microphone and doing frequency analysis.

Can this be accomplished using pytest-bdd? Thanks

youtux commented 2 years ago

Hi, pytest does not support this, and pytest-bdd makes use of the pytest infrastructure to run its tests. Specifically, the fixture resolution part is completely delegated to pytest, so we can't really help with that until pytest adds support for async test execution.

jruizaranguren commented 1 year ago

@youtux There is https://github.com/pytest-dev/pytest-asyncio.