Skip to content

Commit ea1d0a6

Browse files
authored
Add "where to patch" link to the docs
As #386 shows, this is a common problem, so add a link to the docs to help users.
1 parent 91229f9 commit ea1d0a6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/usage.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,10 @@ function decorators for mocking unnecessary, so it will emit a warning when used
157157

158158
If you really intend to mock a context manager, ``mocker.patch.context_manager`` exists
159159
which won't issue the above warning.
160+
161+
Where to patch
162+
--------------
163+
164+
A common issue where mocking appears not to be working is patching in the wrong place.
165+
166+
See this `section in the unittest docs <unittest https://docs.python.org/3/library/unittest.mock.html#where-to-patch>`__ which provides a comprehensive explanation.

0 commit comments

Comments
 (0)