GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() by serhiy-storchaka · Pull Request #23554 · python/cpython Conversation
|
|
It is a draft. Tests which use |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ready for review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 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.
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).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 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.
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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| self.assertAlmostEqual(0.15, loop.time()) | ||
| self.assertEqual(res, 42) | ||
|
|
||
| def test_wait_with_global_loop(self): |
There was a problem 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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| self.assertEqual(y, 'b') | ||
| self.assertAlmostEqual(0.10, loop.time()) | ||
|
|
||
| x = loop.run_until_complete(futs[1]) |
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Please give attention to tests. This is the main part of the PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.