diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-03-28 00:30:02 +0300 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-03-28 00:30:02 +0300 |
commit | ce913877e42b7fa03434c2e765ace891e0f5c4dc (patch) | |
tree | 368cf51d0228cb951d2410a8e62703cc32c11c64 /Lib/unittest/mock.py | |
parent | fa0f62d6ab3d4acf949bd0160bca16f0f973c323 (diff) | |
download | cpython-git-ce913877e42b7fa03434c2e765ace891e0f5c4dc.tar.gz |
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.
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r-- | Lib/unittest/mock.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 976f663c0a..cabae15214 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -2029,6 +2029,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='()') |