diff options
| author | Éric Araujo <merwok@netwok.org> | 2014-03-17 16:50:35 -0400 |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2014-03-17 16:50:35 -0400 |
| commit | 42867c73c9794f8f4968abef0572fd950748559c (patch) | |
| tree | 683e1ea6e9f95d4c66eab334f658d36fdbe27f63 | |
| parent | d890dc16903e9426727525ec977342d3788b20ac (diff) | |
| parent | 0b1be1a3b12c7da952b6452973ad88ae3ef3705a (diff) | |
| download | cpython-git-42867c73c9794f8f4968abef0572fd950748559c.tar.gz | |
Merge 3.4
| -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 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 |
