Skip to content

Commit 0b1be1a

Browse files
committed
Fix typo in example (#20963)
1 parent 28a965f commit 0b1be1a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/library/unittest.mock-examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,8 +934,8 @@ After the `MagicMock` has been used we can use attributes like
934934
the magic methods you specifically want:
935935

936936
>>> mock = Mock()
937-
>>> mock.__setitem__ = Mock(side_effect=getitem)
938-
>>> mock.__getitem__ = Mock(side_effect=setitem)
937+
>>> mock.__getitem__ = Mock(side_effect=getitem)
938+
>>> mock.__setitem__ = Mock(side_effect=setitem)
939939

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

0 commit comments

Comments
 (0)