Skip to content

Small typo in https://docs.python.org/3/library/unittest.mock.html#where-to-patch #130106

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
cmarqu opened this issue Feb 14, 2025 · 1 comment
Closed
Labels
docs Documentation in the Doc dir

Comments

@cmarqu
Copy link

cmarqu commented Feb 14, 2025

https://docs.python.org/3/library/unittest.mock.html#where-to-patch has the text "which we will have to do then it imports" which should be "which we will have to do when it imports" (i.e. s/then/when/).

The source for this is

:func:`patch`. The problem is that when we import module b, which we will have to
do then it imports ``SomeClass`` from module a. If we use :func:`patch` to mock out

Linked PRs

@cmarqu cmarqu added the docs Documentation in the Doc dir label Feb 14, 2025
srinivasreddy added a commit to srinivasreddy/cpython that referenced this issue Feb 14, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 15, 2025
(cherry picked from commit d2e60d8)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 15, 2025
(cherry picked from commit d2e60d8)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <[email protected]>
terryjreedy pushed a commit that referenced this issue Feb 15, 2025
gh-130106: Fix a typo in unittest.mock doc (GH-130107)
(cherry picked from commit d2e60d8)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <[email protected]>
@terryjreedy
Copy link
Member

Dates back to at least 2014, so was backported.

terryjreedy pushed a commit that referenced this issue Feb 15, 2025
gh-130106: Fix a typo in unittest.mock doc (GH-130107)
(cherry picked from commit d2e60d8)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <[email protected]>
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: Todo
Development

No branches or pull requests

2 participants