Skip to content
This repository was archived by the owner on Sep 19, 2019. It is now read-only.

Commit 1163da8

Browse files
committed
fix mock partial example (thanks Michael Foord)
1 parent 37eaae6 commit 1163da8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/comparison.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,8 @@ Creating partial mocks
177177
.. doctest:: creating_partial_mocks
178178

179179
>>> # mock
180-
>>> my_mock = mock.Mock(spec=SomeObject)
181-
>>> my_mock.some_method.return_value = "value"
182-
>>> assertEqual("value", my_mock.some_method())
180+
>>> SomeObject.some_method = mock.Mock(return_value='value')
181+
>>> assertEqual("value", SomeObject.some_method())
183182

184183
>>> # Flexmock
185184
>>> flexmock(SomeObject).should_receive("some_method").and_return('value')

0 commit comments

Comments
 (0)