This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mariocj89
Recipients cjw296, mariocj89, michael.foord, xtreak
Date 2018-11-13.11:27:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
If this is to be done we should not change those tests, I am sure there is code validating calls relying on its "tupleness". Example:


>>> import unittest.mock
>>> m = unittest.mock.Mock()
>>> m(1)
>>> m(2, a=1) 
>>> m.assert_has_calls([
...   ((1,), {}),
...   ((2,), {'a':1}),
... ])


This is documented here:

On the addition in general,
I cannot really comment on the "call(x=1).foo == call(x=2).foo" or how that is supposed to work, I've used those "nesting calls" minimally. I would try to get a hold of Michael Ford.

As a note, I think nesting calls in is supposed to be used only via the method and for calls only.


>>> call(x=1).foo(z=1).call_list() == call(x=1).foo(z=1).call_list()
>>> call(x=2).foo(z=1).call_list() == call(x=1).foo(z=1).call_list()

which "works as expected".

Having support for:

```call(x=1).foo == call(x=2).foo``` is kind of trying to validate an attribute has been accessed, which is a different thing from what mock.calls seems to be doing at the moment. It could be added I guess, but I don't see how do can you use that in `mock.assert_has_calls` for example. What is the "real life" issue that you faced with this issue? Because creating and comparing calls yourself is not something that is usually done, I guess you compared it to a mock call.
Date User Action Args
2018-11-13 11:27:55mariocj89setrecipients: + mariocj89, cjw296, michael.foord, xtreak
2018-11-13 11:27:55mariocj89setmessageid: <>
2018-11-13 11:27:55mariocj89linkissue35226 messages
2018-11-13 11:27:55mariocj89create