From: Éric Araujo Date: Mon, 17 Mar 2014 20:48:13 +0000 (-0400) Subject: Fix typo in example (#20963) X-Git-Tag: v3.4.1rc1~226 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b1be1a3b12c7da952b6452973ad88ae3ef3705a;p=python Fix typo in example (#20963) --- diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst index c5fa365afd..1c43bfe263 100644 --- a/Doc/library/unittest.mock-examples.rst +++ b/Doc/library/unittest.mock-examples.rst @@ -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