File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,14 @@ The supported methods are:
60
60
* ``mocker.patch.dict ``: see http://www.voidspace.org.uk/python/mock/patch.html#patch-dict.
61
61
* ``mocker.stopall() ``: stops all active patches at this point.
62
62
63
+ You can also access ``Mock `` and ``MagicMock `` directly using from ``mocker ``
64
+ fixture:
65
+
66
+ .. code-block :: python
67
+
68
+ def test_feature (mocker ):
69
+ ret = [mocker.Mock(return_value = True ), mocker.Mock(return_value = True )]
70
+ mocker.patch(' mylib.func' , side_effect = ret)
63
71
64
72
Note
65
73
----
Original file line number Diff line number Diff line change 9
9
10
10
setup (
11
11
name = 'pytest-mock' ,
12
- version = '0.4.3 ' ,
12
+ version = '0.5.0 ' ,
13
13
entry_points = {
14
14
'pytest11' : ['pytest_mock = pytest_mock' ],
15
15
},
You can’t perform that action at this time.
0 commit comments