◐ Shell
reader mode source ↗
Skip to content

bpo-37955: mock.patch incorrect reference to Mock#15521

Merged
cjw296 merged 5 commits into
python:masterfrom
phsilva:bpo-37955-incorrect-reference-in-mock-patch-doc
Jan 25, 2020
Merged

bpo-37955: mock.patch incorrect reference to Mock#15521
cjw296 merged 5 commits into
python:masterfrom
phsilva:bpo-37955-incorrect-reference-in-mock-patch-doc

Conversation

@phsilva

@phsilva phsilva commented Aug 26, 2019

Copy link
Copy Markdown
Contributor

mock.patch mentions that keyword arguments are passed
to Mock when it passes to MagicMock by default.

This PR fixes that.

https://bugs.python.org/issue37955

@the-knights-who-say-ni

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Aug 26, 2019
@tirkarthi

Copy link
Copy Markdown
Member

Changing the hyperlink to Mock sounds good to me. But also note like #13681 from 3.8 the default value could be MagicMock or AsyncMock depends on the target. cc: @mariocj89 @cjw296

mock.patch mentions that keyword arguments are passed
to Mock when it passes to MagicMock by default.

This PR fixes that.
@phsilva phsilva force-pushed the bpo-37955-incorrect-reference-in-mock-patch-doc branch from 6c0f647 to 6578726 Compare August 26, 2019 16:08
@phsilva

phsilva commented Aug 26, 2019

Copy link
Copy Markdown
Contributor Author

Changing the hyperlink to Mock sounds good to me. But also note like #13681 from 3.8 the default value could be MagicMock or AsyncMock depends on the target. cc: @mariocj89 @cjw296

The issue on #13681 seems important, the return value on those functions is mostly undocumented right now (since 3.8 changes).

Maybe we should stop mentioning what the actual return type is and say it is whatever is on new_callable and at new_callable we can mention that it depends based on async or not.

This patch adds information about possible use of a AsyncMock
when passing arbitrary arguments to mock.patch.
@phsilva

phsilva commented Nov 30, 2019

Copy link
Copy Markdown
Contributor Author

Latest patch adjust the text to account the suggestions. Appreciate any reviews.

@bedevere-bot

Copy link
Copy Markdown

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.

@phsilva

phsilva commented Dec 2, 2019

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again.

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

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

@bedevere-bot bedevere-bot requested a review from cjw296 December 2, 2019 08:36
@phsilva

phsilva commented Dec 10, 2019

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again.

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

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

@bedevere-bot bedevere-bot requested a review from cjw296 December 10, 2019 01:38
@phsilva phsilva requested a review from lisroach December 12, 2019 03:41
@phsilva

phsilva commented Jan 15, 2020

Copy link
Copy Markdown
Contributor Author

Hi, would be great if can get some review here... Thanks a lot! @lisroach @cjw296

21 hidden items Load more…
@csabella csabella requested review from cjw296, lisroach and tirkarthi and removed request for cjw296 and lisroach January 21, 2020 12:23
@cjw296

cjw296 commented Jan 24, 2020

Copy link
Copy Markdown
Contributor

@csabella: waiting for a response to #15521 (comment)

@cjw296 cjw296 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hide comment

Actually, let's leave the bigger change for another time.

@csabella

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants