File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
- 1.11.2 (unreleased )
1
+ 1.11.2 (2019-10-19 )
2
2
-------------------
3
3
4
4
* The *pytest introspection follows * message is no longer shown
5
5
if there is no pytest introspection (`#154 `_).
6
6
Thanks `@The-Compiler `_ for the report.
7
7
8
+ * ``mocker `` now raises a ``TypeError `` when used as a context-manager.
9
+ Thanks `@binarymason `_ for the PR (`#165 `_).
10
+
8
11
.. _#154 : https://github.com/pytest-dev/pytest-mock/issues/154
12
+ .. _#165 : https://github.com/pytest-dev/pytest-mock/pull/165
13
+ .. _@binarymason : https://github.com/binarymason
9
14
10
15
1.11.1 (2019-10-04)
11
16
-------------------
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ def _enforce_no_with_context(self, stack):
166
166
info = inspect .getframeinfo (frame )
167
167
code_context = " " .join (info .code_context ).strip ()
168
168
169
- if "with mocker" in code_context :
169
+ if code_context . startswith ( "with mocker." ) :
170
170
raise ValueError (
171
171
"Using mocker in a with context is not supported. "
172
172
"https://github.com/pytest-dev/pytest-mock#note-about-usage-as-context-manager"
You can’t perform that action at this time.
0 commit comments