New submission from Allen Li <vianchielfa...@gmail.com>:

mock.patch.dict.__enter__ should return the patched dict/mapping object.

Currently it returns nothing (None).

This would make setting up fixtures more convenient:

 with mock.patch.dict(some.thing):
   some.thing['foo'] = 'bar'

 with mock.patch.dict(some.thing) as x:
   x['foo'] = 'bar'

----------
components: Library (Lib)
messages: 308188
nosy: Allen Li
priority: normal
severity: normal
status: open
title: unittest.mock.patch.dict.__enter__ should return the dict
versions: Python 3.6, Python 3.7, Python 3.8

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

Reply via email to