-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
fix: replace deprecated asyncio.get_event_loop()
with modern approach
#1865
base: develop
Are you sure you want to change the base?
fix: replace deprecated asyncio.get_event_loop()
with modern approach
#1865
Conversation
Replace deprecated get_event_loop() with get_running_loop() and fallback to new_event_loop() to fix the "no current event loop" warning in Python 3.10+
CodSpeed Performance ReportMerging #1865 will not alter performanceComparing Summary
|
Pull Request Test Coverage Report for Build 13026698161Details
💛 - Coveralls |
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.
Use 0.24.1 (unreleased)
instead of 0.24.1
@Abdeldjalil-H, can you please merge your changes with |
7b7e908
to
1232311
Compare
1232311
to
0a7fffd
Compare
Replace deprecated
get_event_loop()
withget_running_loop()
and fallback tonew_event_loop()
to fix the "no current event loop" warning in Python 3.10+ #1824Description
This PR updates the event loop handling in the test suite by replacing the deprecated
asyncio.get_event_loop()
with the modern approach usingget_running_loop()
with a fallback tonew_event_loop()
. The change specifically targets the code in/tortoise/contrib/test/__init__.py
.Motivation and Context
Since Python 3.10, using
asyncio.get_event_loop()
triggers a deprecation warning:DeprecationWarning
: There is no current event loopThis change modernizes the code to use the recommended approach for handling event loops, eliminating the deprecation warning while maintaining functionality.
How Has This Been Tested?
Running tests
Checklist: