[New-bugs-announce] [issue25597] unittest.mock does not wrap dict objects correctly
report at bugs.python.org
Tue Nov 10 12:02:38 EST 2015
New submission from Darragh Bailey:
Both unittest.mock and the backported release for earlier pythons don't appear to support mocking of dictionary objects.
Specifically I'm expecting that any of the methods used to test for membership, or get items from a mock object wrapping a dictionary should succeed. However it appears that MagicMock doesn't appear to support this.
Attached file shows an attempt to use different methods with a wrapped dictionary object where only the '.get()' method appears to work as expected.
nosy: Darragh Bailey
title: unittest.mock does not wrap dict objects correctly
versions: Python 3.5
Added file: http://bugs.python.org/file41001/test-mock-wraps-dict.py
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce