-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() #23554
bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() #23554
Conversation
It is a draft. Tests which use |
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.
Looks good so far.
Ready for review. |
loop = events.get_event_loop() | ||
task = loop.create_task(coro_or_future) | ||
if task._source_traceback: | ||
del task._source_traceback[-1] |
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.
It was removed because this code did not work as intented long time ago (if worked at all).
@@ -1078,33 +1132,6 @@ async def coro(): | |||
res = loop.run_until_complete(asyncio.wait_for(coro(), timeout=None)) | |||
self.assertEqual(res, 'done') | |||
|
|||
def test_wait_for_with_global_loop(self): |
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.
It is virtually a duplicate of the above test. Initially they were different by passing the loop argument or not, now it is removed
@@ -1293,32 +1320,6 @@ async def foo(): | |||
self.assertAlmostEqual(0.15, loop.time()) | |||
self.assertEqual(res, 42) | |||
|
|||
def test_wait_with_global_loop(self): |
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.
It is virtually a duplicate of the above test. Initially they were different by passing the loop argument or not, now it is removed
|
||
x = loop.run_until_complete(futs[1]) |
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.
Currently two parts of the test was virtually duplicates. Added new tests (test_as_completed_coroutine_without_loop
and below) which are essentially different.
Please give attention to tests. This is the main part of the PR. |
This PR is stale because it has been open for 30 days with no activity. |
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.
LGTM, please go ahead.
Sorry for the very long review.
https://bugs.python.org/issue39529