Commit 0b1be1a3 authored by Éric Araujo's avatar Éric Araujo

Fix typo in example (#20963)

parent 28a965ff
...@@ -934,8 +934,8 @@ After the `MagicMock` has been used we can use attributes like ...@@ -934,8 +934,8 @@ After the `MagicMock` has been used we can use attributes like
the magic methods you specifically want: the magic methods you specifically want:
>>> mock = Mock() >>> mock = Mock()
>>> mock.__setitem__ = Mock(side_effect=getitem) >>> mock.__getitem__ = Mock(side_effect=getitem)
>>> mock.__getitem__ = Mock(side_effect=setitem) >>> mock.__setitem__ = Mock(side_effect=setitem)
A *third* option is to use `MagicMock` but passing in `dict` as the `spec` 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 (or `spec_set`) argument so that the `MagicMock` created only has
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment