mirror of
https://github.com/python/cpython.git
synced 2025-10-03 05:35:59 +00:00
gh-117765: Improve documentation for mocker.patch.dict
(#121755)
This commit is contained in:
parent
48042c52a6
commit
8303d32ff5
3 changed files with 5 additions and 2 deletions
|
@ -1624,7 +1624,8 @@ patch.dict
|
||||||
.. function:: patch.dict(in_dict, values=(), clear=False, **kwargs)
|
.. function:: patch.dict(in_dict, values=(), clear=False, **kwargs)
|
||||||
|
|
||||||
Patch a dictionary, or dictionary like object, and restore the dictionary
|
Patch a dictionary, or dictionary like object, and restore the dictionary
|
||||||
to its original state after the test.
|
to its original state after the test, where the restored dictionary is a
|
||||||
|
copy of the dictionary as it was before the test.
|
||||||
|
|
||||||
*in_dict* can be a dictionary or a mapping like container. If it is a
|
*in_dict* can be a dictionary or a mapping like container. If it is a
|
||||||
mapping then it must at least support getting, setting and deleting items
|
mapping then it must at least support getting, setting and deleting items
|
||||||
|
|
|
@ -1829,7 +1829,8 @@ def patch(
|
||||||
class _patch_dict(object):
|
class _patch_dict(object):
|
||||||
"""
|
"""
|
||||||
Patch a dictionary, or dictionary like object, and restore the dictionary
|
Patch a dictionary, or dictionary like object, and restore the dictionary
|
||||||
to its original state after the test.
|
to its original state after the test, where the restored dictionary is
|
||||||
|
a copy of the dictionary as it was before the test.
|
||||||
|
|
||||||
`in_dict` can be a dictionary or a mapping like container. If it is a
|
`in_dict` can be a dictionary or a mapping like container. If it is a
|
||||||
mapping then it must at least support getting, setting and deleting items
|
mapping then it must at least support getting, setting and deleting items
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Improved documentation for :func:`unittest.mock.patch.dict`
|
Loading…
Add table
Add a link
Reference in a new issue