mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #25195: Fix a regression in mock.MagicMock
_Call is a subclass of tuple (changeset 3603bae63c13 only works for classes) so we need to implement __ne__ ourselves. Patch by Andrew Plummer.
This commit is contained in:
commit
5a6c018b57
3 changed files with 24 additions and 0 deletions
|
@ -2047,6 +2047,9 @@ class _Call(tuple):
|
|||
return (other_args, other_kwargs) == (self_args, self_kwargs)
|
||||
|
||||
|
||||
__ne__ = object.__ne__
|
||||
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
if self.name is None:
|
||||
return _Call(('', args, kwargs), name='()')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue