[Python-checkins] cpython (3.4): Fix typo in example (#20963)
eric.araujo
python-checkins at python.org
Mon Mar 17 21:50:58 CET 2014
http://hg.python.org/cpython/rev/e725de5a2760
changeset: 89821:e725de5a2760
branch: 3.4
parent: 89819:06ce648ac6ac
user: Éric Araujo <merwok at netwok.org>
date: Mon Mar 17 16:48:13 2014 -0400
summary:
Fix typo in example (#20963)
files:
Doc/library/unittest.mock-examples.rst | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst
--- a/Doc/library/unittest.mock-examples.rst
+++ b/Doc/library/unittest.mock-examples.rst
@@ -934,8 +934,8 @@
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
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list