Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
Open
Description
Documentation
I always assumed thatunittest.mock.patch.dict made a recursive (deep) copy of the dict and restored it afterwards.
It turns out it is a "simple" copy()
We should maybe clarify that in the documentation
Example:
foo= {"bar": {"baz":1}}withpatch.dict(foo, {"unrelated":123}):foo["bar"]["baz"]=2# baz will stay at 2, assumed it was reset to the original 1
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Todo
Status
Todo