[issue25000] _mock_call does not properly grab args and kwargs

2015-09-08 Thread Michael Foord
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

[issue25000] _mock_call does not properly grab args and kwargs

2015-09-04 Thread Ned Deily
Changes by Ned Deily : -- nosy: +michael.foord, rbcollins -ned.deily, ronaldoussoren versions: -Python 3.2, Python 3.3 ___ Python tracker ___ ___

[issue25000] _mock_call does not properly grab args and kwargs

2015-09-04 Thread Alex Etling
Alex Etling added the comment: I attempted to fix this by just deepcopying on creation of the _call object, on line 927 of mock.py but this caused a lot of strange errors I did not expect. If you could advise on how best to proceed to fix, I would greatly appreciate it. -- _

[issue25000] _mock_call does not properly grab args and kwargs

2015-09-04 Thread Alex Etling
New submission from Alex Etling: Consider the following lines of code: def test_mock(val): fake_mock = Mock() a = {} fake_mock.func(a) a['val'] = 5 fake_mock.func.assert_has_calls([call({})]) What i would expect would be for this statement to pass. What I actually see is t