File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change
1
+ 3.5.0 (2021-01-04)
2
+ ------------------
3
+
4
+ * Now all patch functions will emit a warning instead of raising a ``ValueError `` when used
5
+ as a context-manager. Thanks `@iforapsy `_ for the PR (`#221 `_).
6
+
7
+ * Additionally, ``mocker.patch.context_manager `` is available when the user intends to mock
8
+ a context manager (for example ``threading.Lock `` object), which will not emit that
9
+ warning.
10
+
11
+ .. _@iforapsy : https://github.com/iforapsy
12
+ .. _#221 : https://github.com/pytest-dev/pytest-mock/pull/221
13
+
1
14
3.4.0 (2020-12-15)
2
15
------------------
3
16
Original file line number Diff line number Diff line change @@ -261,7 +261,10 @@ fixture:
261
261
assert a.doIt() == True
262
262
263
263
The purpose of this plugin is to make the use of context managers and
264
- function decorators for mocking unnecessary.
264
+ function decorators for mocking unnecessary, so it will emit a warning when used as such.
265
+
266
+ If you really intend to mock a context manager, ``mocker.patch.context_manager `` exists
267
+ which won't issue the above warning.
265
268
266
269
267
270
Requirements
You can’t perform that action at this time.
0 commit comments