[docs] [issue20963] side_effects swapped in Mock example

chris-buccella report at bugs.python.org
Mon Mar 17 21:34:47 CET 2014

New submission from chris-buccella:


Section 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)

assignee: docs at python
components: Documentation
messages: 213891
nosy: chris-buccella, docs at python
priority: normal
severity: normal
status: open
title: side_effects swapped in Mock example
versions: Python 3.4, Python 3.5

Python tracker <report at bugs.python.org>

More information about the docs mailing list