[issue25000] _mock_call does not properly grab args and kwargs

Michael Foord report at bugs.python.org
Tue Sep 8 16:29:21 CEST 2015


Michael Foord added the comment:

This is actually the specified and documented behaviour of mock when it is passed mutable arguments. Deep copying arguments on calls is rife with potential problems (not everything can be copied and it breaks comparison by identity). The documentation suggests ways around this:

https://docs.python.org/3/library/unittest.mock-examples.html#coping-with-mutable-arguments

----------
resolution:  -> not a bug
status: open -> closed

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


More information about the Python-bugs-list mailing list