[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:

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)

----------
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>
<http://bugs.python.org/issue20963>
_______________________________________


More information about the docs mailing list