This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris-buccella
Recipients chris-buccella, docs@python
Date 2014-03-17.20:34:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395088487.87.0.432114186877.issue20963@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2014-03-17 20:34:47chris-buccellasetrecipients: + chris-buccella, docs@python
2014-03-17 20:34:47chris-buccellasetmessageid: <1395088487.87.0.432114186877.issue20963@psf.upfronthosting.co.za>
2014-03-17 20:34:47chris-buccellalinkissue20963 messages
2014-03-17 20:34:47chris-buccellacreate