Fix up Python 3.8 loop argument warnings#246
Merged
asvetlov merged 8 commits intoaio-libs:masterfrom Apr 23, 2020
Merged
Conversation
* Remove all "loop=self.loop" expressions. * Rely on the currently running loop in the constructor of Queue. * Assuming that janus.Queue objects are created in the functions or coroutines called by the event loop, rewrite most test cases to be async. - No longer manage the event loop lifecycles by ourselves. - Adopt pytest-asyncio to seamlessly run test cases in an event loop. * Add missing .close() / .wait_closed() calls to the end of many test cases to ensure proper termination of the queues. * Insert asyncio.sleep(0) in the wait_closed() method so that all task-done callbacks for tasks spawned by _notify_async_not_empty(), _notify_async_not_full() internal methods are properly awaited. This eliminates hundreds of resource warnings after finishing the test suite. * Ensure dropping of Python 3.3/3.4 in CI configs. * Add Python 3.7 and 3.8 to CI configs.
Codecov Report
@@ Coverage Diff @@
## master #246 +/- ##
=======================================
Coverage 99.67% 99.67%
=======================================
Files 1 1
Lines 308 309 +1
Branches 40 41 +1
=======================================
+ Hits 307 308 +1
Partials 1 1
Continue to review full report at Codecov.
|
* Remove PY_33/PY_35 conditional branches as we no longer support Python 3.4 or older versions.
Member
Author
|
@asvetlov Just a poke, please have a look at this PR. |
asvetlov
approved these changes
Apr 23, 2020
Member
asvetlov
left a comment
There was a problem hiding this comment.
Awesome!
Very impressive work, thanks!
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.
What do these changes do?
loop=self.loopexpressions.janus.Queueobjects are created in the functions or coroutines called by the event loop, rewrite most test cases to be async..close()/.wait_closed()calls to the end of many test cases to ensure proper termination of the queues.asyncio.sleep(0)in thewait_closed()method so that all task-done callbacks for tasks spawned by_notify_async_not_empty(),_notify_async_not_full()internal methods are properly awaited.This eliminates hundreds of resource warnings after finishing the test suite and loop termination after using
.join()APIs.Are there changes in behavior for the user?
Users are no longer able to create
janus.Queueinstances in the codes running outside event loops (even when they have references to an existing event loop running somewhere else).Related issue number
#229
Checklist
CHANGESfolderCHANGESfolder, so I've added a bullet inCHANGES.rstdirectly.