Skip to content

Commit

Permalink
Fix typo in example (python#20963)
Browse files Browse the repository at this point in the history
  • Loading branch information
merwok committed Mar 17, 2014
1 parent 28a965f commit 0b1be1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/unittest.mock-examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,8 @@ After the `MagicMock` has been used we can use attributes like
the magic methods you specifically want:

>>> mock = Mock()
>>> mock.__setitem__ = Mock(side_effect=getitem)
>>> mock.__getitem__ = Mock(side_effect=setitem)
>>> mock.__getitem__ = Mock(side_effect=getitem)
>>> mock.__setitem__ = Mock(side_effect=setitem)

A *third* option is to use `MagicMock` but passing in `dict` as the `spec`
(or `spec_set`) argument so that the `MagicMock` created only has
Expand Down

0 comments on commit 0b1be1a

Please sign in to comment.