summaryrefslogtreecommitdiff
path: root/mock.py
diff options
context:
space:
mode:
authorMichael Foord <michael@voidspace.org.uk>2012-01-10 00:22:44 +0000
committerMichael Foord <michael@voidspace.org.uk>2012-01-10 00:22:44 +0000
commitd311f604c97c49253ec316fe206af8da2ca95d4d (patch)
tree0b9608d50466c7223573a044edff2b1a0712846c /mock.py
parentbb4646c35f1fda5bba00af04e18bef57a7c884fa (diff)
downloadmock-d311f604c97c49253ec316fe206af8da2ca95d4d.tar.gz
Fix ANY equality with some types in assert_called_with calls
Diffstat (limited to 'mock.py')
-rw-r--r--mock.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mock.py b/mock.py
index 722ab40..1be7f50 100644
--- a/mock.py
+++ b/mock.py
@@ -1883,6 +1883,9 @@ class _ANY(object):
def __eq__(self, other):
return True
+ def __ne__(self, other):
+ return False
+
def __repr__(self):
return '<ANY>'
@@ -2010,7 +2013,9 @@ class _Call(tuple):
if self_name and other_name != self_name:
return False
- return (self_args, self_kwargs) == (other_args, other_kwargs)
+
+ # this order is important for ANY to work!
+ return (other_args, other_kwargs) == (self_args, self_kwargs)
def __ne__(self, other):