[issue28318] Python unittest.mock.mock_calls stores references to arguments instead of their values

Guillaume Chorn report at bugs.python.org
Mon Oct 3 14:17:39 EDT 2016


Guillaume Chorn added the comment:

If it's true that our ability to accurately deep-copy mutable args makes fixing this behavior impossible, we should at the very least update the official unittest.mock documentation to warn users that testing for mock calls with mutable arguments is not reliable; i.e. make it clear that we're storing a reference to the arguments and not just the values. If it's not a bug, it's certainly a limitation that deserves as much mention as possible.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28318>
_______________________________________


More information about the Python-bugs-list mailing list