FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.10] gh-95010: Fix asyncio GenericWatcherTests.test_create_subprocess_fail… by graingert · Pull Request #95099 · python/cpython · GitHub

/ cpython Public

[3.10] gh-95010: Fix asyncio GenericWatcherTests.test_create_subprocess_fail… - #95099

Closed
graingert wants to merge 2 commits into
python:3.10from
graingert:backport-834bd5d-3.10
Closed

[3.10] gh-95010: Fix asyncio GenericWatcherTests.test_create_subprocess_fail…#95099
graingert wants to merge 2 commits into
python:3.10from
graingert:backport-834bd5d-3.10

Conversation

graingert commented Jul 21, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

…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 tagrain@gmail.com

…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 <tagrain@gmail.com>
bedevere-bot added tests Tests in the Lib/test dir awaiting review labels Jul 21, 2022
graingert force-pushed the backport-834bd5d-3.10 branch from 9035b28 to 4b59f79 Compare July 21, 2022 17:59
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why not just use self.loop.run_until_complete() as in other tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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)

graingert force-pushed the backport-834bd5d-3.10 branch from 4b59f79 to ca48762 Compare July 21, 2022 18:36

Copy link
Copy Markdown
Contributor Author

I think I'll try to hurdle this hurdle when backporting #94184

graingert closed this Jul 23, 2022
graingert deleted the backport-834bd5d-3.10 branch July 23, 2022 01:47
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

Labels

awaiting review skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL