[issue21692] Wrong order of expected/actual for assert_called_once_with

2014-06-09 Thread Fei Long Wang
Fei Long Wang added the comment: Okay, I can see your point now. Thanks for the clarification. -- ___ Python tracker ___ ___ Python-bu

[issue21692] Wrong order of expected/actual for assert_called_once_with

2014-06-09 Thread Michael Foord
Michael Foord added the comment: As David points out - in your example the "actual call" made is m.some_method('foo', 'bar'). Your assertion (the expectation) is m.some_method.assert_called_once_with('foo', 'baz'). So the traceback is correct. I don't think the ordering of expected/actual in

[issue21692] Wrong order of expected/actual for assert_called_once_with

2014-06-08 Thread R. David Murray
R. David Murray added the comment: But the actual call that you made in your example was some_method('foo', 'bar'). Given that we conventionally write unittest assertions with the actual result first and the expected result second (assertEqual(actual, expected), it might be less confusing if t

[issue21692] Wrong order of expected/actual for assert_called_once_with

2014-06-08 Thread Fei Long Wang
Fei Long Wang added the comment: IMHO, the trace should be: AssertionError: Expected call: some_method('foo', 'bar') Actual call: some_method('foo', 'baz') instead of below: AssertionError: Expected call: some_method('foo', 'baz') Actual call: some_method('foo', 'bar'

[issue21692] Wrong order of expected/actual for assert_called_once_with

2014-06-08 Thread Michael Foord
Michael Foord added the comment: What specifically are you saying is in the wrong order? -- ___ Python tracker ___ ___ Python-bugs-lis

[issue21692] Wrong order of expected/actual for assert_called_once_with

2014-06-08 Thread Ned Deily
Changes by Ned Deily : -- nosy: +michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue21692] Wrong order of expected/actual for assert_called_once_with

2014-06-08 Thread Fei Long Wang
New submission from Fei Long Wang: >>> m=mock.Mock() >>> m.some_method('foo', 'bar') >>> m.some_method.assert_called_once_with('foo', 'bar') >>> m.some_method.assert_called_once_with('foo', 'baz') Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-pac