Add support for async steps & scenarios#349
Open
amadeuszhercog-silvair wants to merge 22 commits intopytest-dev:masterfrom
Open
Add support for async steps & scenarios#349amadeuszhercog-silvair wants to merge 22 commits intopytest-dev:masterfrom
amadeuszhercog-silvair wants to merge 22 commits intopytest-dev:masterfrom
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? |
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to #223
This pull request adds support for asynchronous steps and scenario functions. As i wrote in
README.rstuser 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
asynciointotests/asyncio. Their structure is following:test_async_given_returns_value.py- tests checking that asyncgivenis 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_taskand 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.