-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
AioHTTPTestCase more async friendly #4732
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4732 +/- ##
=======================================
Coverage 97.54% 97.54%
=======================================
Files 43 43
Lines 8794 8794
Branches 1413 1415 +2
=======================================
Hits 8578 8578
Misses 101 101
Partials 115 115
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I've added tests to prove the new capabilities of AioHTTPTestCase, Maybe the next step would be to add patch tests? Should |
0de17e9
to
f39d103
Compare
This comment has been minimized.
This comment has been minimized.
@asvetlov how can I solve the CLA that is not signed? |
0204728
to
2910600
Compare
Please forget about the CLA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I thought that the difference between asynctest
and IsolatedAsyncioTestCase
is bigger.
Co-authored-by: Andrew Svetlov <[email protected]>
Co-authored-by: Andrew Svetlov <[email protected]>
Co-authored-by: Andrew Svetlov <[email protected]>
💔 Backport was not successfulThe PR was attempted backported to the following branches:
|
Co-authored-by: Andrew Svetlov <[email protected]>. (cherry picked from commit 5357858) Co-authored-by: Anas <[email protected]>
Co-authored-by: Andrew Svetlov <[email protected]>. (cherry picked from commit 5357858) Co-authored-by: Anas <[email protected]> Co-authored-by: Anas <[email protected]>
Co-authored-by: Andrew Svetlov <[email protected]>
Co-authored-by: Andrew Svetlov <[email protected]>
Since aio-libs#4732, it's wrong to says that `setUpAsync()` and `tearDownAsync()` do nothing and can be overridden without calling `super.setUpAsync()` and `super.tearDownAsync()`.
Since aio-libs#4732, it's wrong to says that `setUpAsync()` and `tearDownAsync()` do nothing and can be overridden without calling `super.setUpAsync()` and `super.tearDownAsync()`.
Since aio-libs#4732, it's wrong to says that `setUpAsync()` and `tearDownAsync()` do nothing and can be overridden without calling `super.setUpAsync()` and `super.tearDownAsync()`.
Since aio-libs#4732, it's wrong to says that `setUpAsync()` and `tearDownAsync()` do nothing and can be overridden without calling `super.setUpAsync()` and `super.tearDownAsync()`.
Since #4732, it's wrong to says that `setUpAsync()` and `tearDownAsync()` do nothing and can be overridden without calling `super.setUpAsync()` and `super.tearDownAsync()`.
#6318) Since #4732, it's wrong to says that `setUpAsync()` and `tearDownAsync()` do nothing and can be overridden without calling `super.setUpAsync()` and `super.tearDownAsync()`. (cherry picked from commit d149eff) Co-authored-by: Hoel IRIS <[email protected]>
#6317) Since #4732, it's wrong to says that `setUpAsync()` and `tearDownAsync()` do nothing and can be overridden without calling `super.setUpAsync()` and `super.tearDownAsync()`. (cherry picked from commit d149eff) Co-authored-by: Hoel IRIS <[email protected]>
What do these changes do?
Make AioHTTPTestCase more async friendly, making a user able to run a test case with async methods without needing to use
@unittest_run_loop
decorator, adding a dependency for testing for python3.7 and below as mentioned in #4700 and #4695 while using built in asyncio test case available from python 3.8This change is backward compatible, I did not change any name of classes or methods.
Are there changes in behavior for the user?
Yes, test can be written with async functions without
@unittest_run_loop
.For python3.7 and below
asynctest
dependency must be installed.Testing becomes more straight forward like the following
Related issue number
#4700 and #4695
#4700 will be resolved after this merge
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.I did not add any new tests, it seems to me that the old tests are passing, I would be glad to know if this kind of change is welcome so that I can proceed with the docs and more testing maybe on the patching side like I pointed out in this PR #4697