[New-bugs-announce] [issue38346] Wrong behavior when using `assert_called_with` with mutable object

Jim Jeon report at bugs.python.org
Wed Oct 2 04:52:49 EDT 2019


New submission from Jim Jeon <jimjeon.me at gmail.com>:

When `assert_called_with` is used with mutable object, test fails if the object has changed. I think this is not what it meant to do.

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

The same situation is explained in this document. But I don't understand why they did not fix and just are proposing some solutions to the users.

----------
components: Tests
files: Screen Shot 2019-10-02 at 5.22.05 PM.png
messages: 353727
nosy: Jim Jeon
priority: normal
severity: normal
status: open
title: Wrong behavior when using `assert_called_with` with mutable object
type: enhancement
versions: Python 3.7
Added file: https://bugs.python.org/file48638/Screen Shot 2019-10-02 at 5.22.05 PM.png

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


More information about the New-bugs-announce mailing list