-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
bpo-37955: mock.patch incorrect reference to Mock #15521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
6578726
7c55aaa
39dd5a0
bebae7a
0744968
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1651,7 +1651,8 @@ def patch( | |
| "as"; very useful if `patch` is creating a mock object for you. | ||
|
|
||
| `patch` takes arbitrary keyword arguments. These will be passed to | ||
| the `Mock` (or `new_callable`) on construction. | ||
| to construct a `AsyncMock` if the patched object is an async function, | ||
| to `MagicMock` otherwise or to `new_callable` if specified. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any way we could not have this text duplicated between mock.py and mock.rst?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am new to Python docs, but as far as I looked around there is a lot of duplication between .rst and .py in many modules, will need to ask around about if there is another way.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes this a more substantial PR, but Sphinx autodoc should be able to pull in the .py's docstrings. Not sure if autodoc is enabled for the CPython docs, that would be some more digging on your part :-)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will take a look into it, but it looks like all modules actually repeats docs in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did the asking around go? |
||
|
|
||
| `patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are | ||
| available for alternate use-cases. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.