GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@graingert graingert commented Jul 21, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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 [email protected]

  • Issue: test_asyncio's GenericWatcherTests.test_create_subprocess_fails_with_inactive_watcher is not run #95010

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@graingert @miss-islington
pythongh-95010: Fix asyncio GenericWatcherTests.test_create_subproces…
3b4ee85
…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]>
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting review labels Jul 21, 2022
@graingert
graingert force-pushed the backport-834bd5d-3.10 branch from 9035b28 to 4b59f79 Compare July 21, 2022 17:59
@serhiy-storchaka 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
@bedevere-bot bedevere-bot added the skip news label Jul 21, 2022
serhiy-storchaka
serhiy-storchaka reviewed Jul 21, 2022
View reviewed changes
Comment thread Lib/test/test_asyncio/test_subprocess.py Outdated
Comment on lines 864 to 868

@serhiy-storchaka serhiy-storchaka Jul 21, 2022

Copy link
Copy Markdown
Member

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.

All reactions

@graingert graingert Jul 21, 2022

Copy link
Copy Markdown
Contributor Author

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.

All reactions

@serhiy-storchaka serhiy-storchaka Jul 21, 2022

Copy link
Copy Markdown
Member

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.

All reactions
@graingert
backport Runner for test_asyncio.test_subprocess
ca48762
@graingert
graingert force-pushed the backport-834bd5d-3.10 branch from 4b59f79 to ca48762 Compare July 21, 2022 18:36
@graingert

graingert commented Jul 23, 2022

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@graingert graingert closed this Jul 23, 2022
@graingert
graingert deleted the backport-834bd5d-3.10 branch July 23, 2022 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka left review comments
@1st1 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 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

Labels

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

Projects

None yet

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.

3 participants

@graingert @serhiy-storchaka @bedevere-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.