diff options
author | Éric Araujo <merwok@netwok.org> | 2014-03-17 20:50:35 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2014-03-17 20:50:35 (GMT) |
commit | 42867c73c9794f8f4968abef0572fd950748559c (patch) | |
tree | 683e1ea6e9f95d4c66eab334f658d36fdbe27f63 /Doc | |
parent | d890dc16903e9426727525ec977342d3788b20ac (diff) | |
parent | 0b1be1a3b12c7da952b6452973ad88ae3ef3705a (diff) | |
download | cpython-42867c73c9794f8f4968abef0572fd950748559c.zip cpython-42867c73c9794f8f4968abef0572fd950748559c.tar.gz cpython-42867c73c9794f8f4968abef0572fd950748559c.tar.bz2 |
Merge 3.4
Diffstat (limited to 'Doc')
-rw-r--r-- | 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 index c5fa365..1c43bfe 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 |