summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/mock.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-21 21:12:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-21 21:12:58 (GMT)
commit362f058a89437f82f112cda439bb40abe4ddb8c5 (patch)
tree611247b1a867cddbd466c646d95665ed8508acbc /Lib/unittest/mock.py
parent6ad85bf89a0524637a89f2950468d2630929fdb2 (diff)
downloadcpython-362f058a89437f82f112cda439bb40abe4ddb8c5.zip
cpython-362f058a89437f82f112cda439bb40abe4ddb8c5.tar.gz
cpython-362f058a89437f82f112cda439bb40abe4ddb8c5.tar.bz2
Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY.
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r--Lib/unittest/mock.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 669890a..0512cca 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -1749,14 +1749,18 @@ def _get_eq(self):
ret_val = self.__eq__._mock_return_value
if ret_val is not DEFAULT:
return ret_val
- return self is other
+ if self is other:
+ return True
+ return NotImplemented
return __eq__
def _get_ne(self):
def __ne__(other):
if self.__ne__._mock_return_value is not DEFAULT:
return DEFAULT
- return self is not other
+ if self is other:
+ return False
+ return NotImplemented
return __ne__
def _get_iter(self):