Skip to content

Make mocker.patch.dict documentation clearer on actual behavior #117765

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

Closed
radhikamattoo opened this issue Apr 11, 2024 · 1 comment
Closed

Make mocker.patch.dict documentation clearer on actual behavior #117765

radhikamattoo opened this issue Apr 11, 2024 · 1 comment
Labels
docs Documentation in the Doc dir

Comments

@radhikamattoo
Copy link

radhikamattoo commented Apr 11, 2024

Documentation

The docs for patch.dict method is:

Patch a dictionary, or dictionary like object, and restore the dictionary to its original state after the test.

The phrase "to its original state" can be misleading, because this method actually restores a copy of the original data.

I ran into strange behavior with my tests because of my assumption this method would restore the original values, not copies of them.

Let me know if I'm misunderstanding anything :) Thanks all for your hard work!

Linked PRs

@hugovk
Copy link
Member

hugovk commented Aug 8, 2024

Triage: closing because the PR has been merged, please re-open if still needed. Thanks!

@hugovk hugovk closed this as completed Aug 8, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Unittest issues Aug 8, 2024
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
Projects
Status: Done
Development

No branches or pull requests

2 participants