GeezerVison is showing github.com — [3.10] gh-95010: Fix asyncio GenericWatcherTests.test_create_subprocess_fail… by graingert · Pull Request #95099 · python/cpython
Conversation
graingert
commented
Jul 21, 2022
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
…s_with_inactive_watcher (GH-95009)
The test was never run, because it was missing the TestCase class.
The test failed because the wrong attribute was patched.
(cherry picked from commit 834bd5d)
Co-authored-by: Thomas Grainger [email protected]
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…s_fails_with_inactive_watcher (pythonGH-95009)
The test was never run, because it was missing the TestCase class.
The test failed because the wrong attribute was patched.
(cherry picked from commit 834bd5d)
Co-authored-by: Thomas Grainger <[email protected]>
serhiy-storchaka
changed the title
gh-95010: Fix asyncio GenericWatcherTests.test_create_subprocess_fail…
[3.10] gh-95010: Fix asyncio GenericWatcherTests.test_create_subprocess_fail…
Jul 21, 2022
Comment on lines
864
to
868
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.
Why not just use self.loop.run_until_complete() as in other tests?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
the GenericWatcherTests don't have a self.loop, and SubprocessWatcherMixin (which sets self.loop) calls get_event_loop_policy().attach_loop and this test case is testing what happens when attach_loop isn't called
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Many classes set self.loop. For this test you can inherit from test_utils.TestCase and add
def setUp(self):
super().setUp()
self.loop = asyncio.new_event_loop()
self.set_event_loop(self.loop)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I think I'll try to hurdle this hurdle when backporting #94184
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1st1
Awaiting requested review from 1st1
1st1 will be requested when the pull request is marked ready for review
1st1 is a code owner
asvetlov
Awaiting requested review from asvetlov
asvetlov will be requested when the pull request is marked ready for review
asvetlov is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.