Fix typo in example (#20963)

This commit is contained in:
Éric Araujo 2014-03-17 16:48:13 -04:00
parent 28a965ff71
commit 0b1be1a3b1
1 changed files with 2 additions and 2 deletions

View File

@ -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