-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for async steps & scenarios #349
base: master
Are you sure you want to change the base?
Add support for async steps & scenarios #349
Conversation
I don't think the test with the app is worth to add all those testing requirements. Otherwise, I like the PR. I think adding a native support for asyncio is useful! |
Are there any plans to look at getting this merged? |
Hi @amadeuszhercog-silvair, please check my comment about trying to use a different approach for this issue. It would be better to have async code compatibility without being tied to a specific pytest plugin. |
Relates to #223
This pull request adds support for asynchronous steps and scenario functions. As i wrote in
README.rst
user will be able to use async steps and scenarios out of the box like this:Explanation about tests
I've put all tests that use
asyncio
intotests/asyncio
. Their structure is following:test_async_given_returns_value.py
- tests checking that asyncgiven
is a fixture or it can shadow other fixture,test_async_scenario_function.py
- tests for scenario function,test_async_steps.py
- tests for async steps,test_launching_app_in_background.py
- (bigger than above ones) test that will launch dummy application based on asyncio inevent_loop.create_task
and will interact with it by http protocol. It checks that app is still running between steps and it can respond.dummy_app.py
- dummy app from previous point + flask app with which is "gateway" between dummy app and tests.Data flow of tests based on dummy app looks like this:
That PR will require dropping Python 2.7 support before. But since Python 2.7 is no longer officially supported anyway I don't think it would be a problem.