Skip to content

Commit 9c8c3d4

Browse files
committed
Update README and bump version to 0.5
1 parent 7295065 commit 9c8c3d4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.rst

+8
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ The supported methods are:
6060
* ``mocker.patch.dict``: see http://www.voidspace.org.uk/python/mock/patch.html#patch-dict.
6161
* ``mocker.stopall()``: stops all active patches at this point.
6262

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)
6371
6472
Note
6573
----

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='pytest-mock',
12-
version='0.4.3',
12+
version='0.5.0',
1313
entry_points={
1414
'pytest11': ['pytest_mock = pytest_mock'],
1515
},

0 commit comments

Comments
 (0)