[issue38346] Wrong behavior when using `assert_called_with` with mutable object

Karthikeyan Singaravelan report at bugs.python.org
Wed Oct 2 08:03:41 EDT 2019


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

As explained copy would cause backwards incompatible change on objects that depend on identity comparison. I am not sure if this can be fixed in a backwards compatible manner.

> One possibility would be for mock to copy the arguments you pass in. This could then cause problems if you do assertions that rely on object identity for equality.

----------
nosy: +cjw296, lisroach, mariocj89, michael.foord, xtreak

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


More information about the Python-bugs-list mailing list