diff options
author | Éric Araujo <merwok@netwok.org> | 2014-03-17 20:48:13 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2014-03-17 20:48:13 (GMT) |
commit | 0b1be1a3b12c7da952b6452973ad88ae3ef3705a (patch) | |
tree | 3d8f5def65becb5f27c1bcbc209bcfe1ea4b68e1 | |
parent | 28a965ff71a00d89f37b88ca73ae61adf94de544 (diff) | |
download | cpython-0b1be1a3b12c7da952b6452973ad88ae3ef3705a.zip cpython-0b1be1a3b12c7da952b6452973ad88ae3ef3705a.tar.gz cpython-0b1be1a3b12c7da952b6452973ad88ae3ef3705a.tar.bz2 |
Fix typo in example (#20963)
-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 |