Skip to content

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

Closed

Description

@radhikamattoo

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

Activity

  1. added a commit that references this issue on Jul 15, 2024
  2. added a commit that references this issue on Jul 17, 2024
  3. hugovk commented on Aug 8, 2024

    @hugovk
    Member

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions