summaryrefslogtreecommitdiff
path: root/Lib/unittest/mock.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-03-28 00:30:02 +0300
committerBerker Peksag <berker.peksag@gmail.com>2016-03-28 00:30:02 +0300
commitfd4e059645345fa0f4339dd44c09bfa3c76a82c5 (patch)
tree3bccd8b2f7b6ab2deec98eafff4539666256d815 /Lib/unittest/mock.py
parent2e5622d16e06c61552b6ab6bb4ab8a03d9533c90 (diff)
downloadcpython-fd4e059645345fa0f4339dd44c09bfa3c76a82c5.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.py3
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='()')