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.

----------
files: test-mock-wraps-dict.py
messages: 254453
nosy: Darragh Bailey
priority: normal
severity: normal
status: open
title: unittest.mock does not wrap dict objects correctly
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file41001/test-mock-wraps-dict.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25597>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to