[issue32632] Mock does not create deepcopy of mutable args

2018-01-23 Thread Michael Foord
Michael Foord added the comment: There are several disadvantages to doing deepcopy: * identity checks now fail * deep copying is slow * deep copying doesn't work on arbitrary objects So deep copying by default isn't a good idea. This particular case is mentioned in

[issue32632] Mock does not create deepcopy of mutable args

2018-01-22 Thread Sergey
New submission from Sergey : MagicMock allows to check parameters of calls by using "assert_has_calls". However it fails if argument has a mutable type and was changed in-place before the second call. The example is provided in attached file. In "func1" value in "data"