derwiki-adroll / mock

Automatically exported from code.google.com/p/mock
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Better signature representation for failed assertCalledWith #126

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like to suggest a more intuitive signature representation for reporting the 
following test failure:

m = Mock()
m(1, foo=2)
m.assert_called_with(1, foo=3)
Traceback (most recent call last):
...
AssertionError: Expected: ((1,), {'foo': 3})
Called with: ((1,), {'foo': 2})

It would be much easier to read if the "Expected" and "Called with" expressions 
read

(1, foo=2)  and  (1, foo=3), resp.

The above output was obtained using mock 0.7.0b4 with Python 2.6 on Linux.

Original issue reported on code.google.com by tho...@thomas-lotze.de on 12 Dec 2011 at 6:45

GoogleCodeExporter commented 9 years ago
Already done in 0.8 beta.

Original comment by fuzzyman on 12 Dec 2011 at 8:33