[issue41296] unittest.mock: patched mocks do not propagate calls to parent when set via setattr

thinkingmachin6 report at bugs.python.org
Tue Jul 14 15:47:08 EDT 2020


thinkingmachin6 <john.a.passaro at gmail.com> added the comment:

This appears to be a case of RTFM (https://docs.python.org/3/library/unittest.mock.html#attaching-mocks-as-attributes). For anybody that comes across this, the short answer is use `attach_mock()` instead of plain attribute-setting.

----------
resolution:  -> not a bug

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41296>
_______________________________________


More information about the Python-bugs-list mailing list