summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/mock.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-03-27 21:30:02 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2016-03-27 21:30:02 (GMT)
commitce913877e42b7fa03434c2e765ace891e0f5c4dc (patch)
tree368cf51d0228cb951d2410a8e62703cc32c11c64 /Lib/unittest/mock.py
parentfa0f62d6ab3d4acf949bd0160bca16f0f973c323 (diff)
downloadcpython-ce913877e42b7fa03434c2e765ace891e0f5c4dc.zip
cpython-ce913877e42b7fa03434c2e765ace891e0f5c4dc.tar.gz
cpython-ce913877e42b7fa03434c2e765ace891e0f5c4dc.tar.bz2
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 976f663..cabae15 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='()')