◐ Shell
clean mode source ↗

gh-103780: Use patch instead of mock in asyncio unix events test by itamaro · Pull Request #103782 · python/cpython

@itamaro

I don't think a news entry is needed for this

carljm

Choose a reason for hiding this comment

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

Looking at the rest of the module, I think the form of patching that would be most consistent with the rest of the module would be the decorator form (which also avoids introducing a new indentation level):

@mock.patch('asyncio.unix_events.can_use_pidfd')
def test_get_default_child_watcher(self, m_can_use_pidfd):
    m_can_use_pidfd.return_value = False
    ...
    m_can_use_pidfd.return_value = True
    ...

@bedevere-bot

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@itamaro

I have made the requested changes; please review again

@bedevere-bot

Thanks for making the requested changes!

@carljm: please review the changes made to this pull request.

carljm

@miss-islington

Thanks @itamaro for the PR, and @carljm for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington

Sorry, @itamaro and @carljm, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 518050ced18422fd00fadc1a81b0d942b98e2e5b 3.11

carljm added a commit to carljm/cpython that referenced this pull request

Apr 24, 2023

carljm added a commit to carljm/cpython that referenced this pull request

Apr 24, 2023