[issue33667] Mock calls on mutable objects

Pawel report at bugs.python.org
Mon May 28 09:12:45 EDT 2018


New submission from Pawel <inne.poczta at gmail.com>:

When method of mocked object is called multiple times with mutable object as parameter and attribute of this object has been updated between calls, mock_calls is only aware of the last value. I think it unexpected behaviour, that mock doesn't track value changes.
I've attached example code

----------
components: Tests
files: test.py
messages: 317849
nosy: pawelj
priority: normal
severity: normal
status: open
title: Mock calls on mutable objects
type: behavior
versions: Python 3.5, Python 3.6
Added file: https://bugs.python.org/file47618/test.py

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


More information about the Python-bugs-list mailing list