Issue 20963: side_effects swapped in Mock example (original) (raw)
Issue20963
Created on 2014-03-17 20:34 by chris-buccella, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg213891 - (view) | Author: (chris-buccella) | Date: 2014-03-17 20:34 |
http://docs.python.org/3.4/library/unittest.mock-examples.html Section 26.5.3.9. Mocking a dictionary with MagicMock In the Note area: >>> mock.__setitem__ = Mock(side_effect=getitem) >>> mock.__getitem__ = Mock(side_effect=setitem) I think these are swapped; should be: >>> mock.__setitem__ = Mock(side_effect=setitem) >>> mock.__getitem__ = Mock(side_effect=getitem) | ||
msg213893 - (view) | Author: Éric Araujo (eric.araujo) * ![]() |
Date: 2014-03-17 20:46 |
Thanks, will fix. | ||
msg213894 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2014-03-17 20:50 |
New changeset e725de5a2760 by Éric Araujo in branch '3.4': Fix typo in example (#20963) http://hg.python.org/cpython/rev/e725de5a2760 |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:00 | admin | set | github: 65162 |
2014-03-17 20:51:50 | eric.araujo | set | status: open -> closedresolution: fixedstage: resolved |
2014-03-17 20:50:58 | python-dev | set | nosy: + python-devmessages: + |
2014-03-17 20:46:29 | eric.araujo | set | assignee: docs@python -> eric.araujomessages: + nosy: + eric.araujo |
2014-03-17 20:34:47 | chris-buccella | create |