diff options
author | Michael Foord <michael@voidspace.org.uk> | 2012-01-10 00:22:44 +0000 |
---|---|---|
committer | Michael Foord <michael@voidspace.org.uk> | 2012-01-10 00:22:44 +0000 |
commit | d311f604c97c49253ec316fe206af8da2ca95d4d (patch) | |
tree | 0b9608d50466c7223573a044edff2b1a0712846c /mock.py | |
parent | bb4646c35f1fda5bba00af04e18bef57a7c884fa (diff) | |
download | mock-d311f604c97c49253ec316fe206af8da2ca95d4d.tar.gz |
Fix ANY equality with some types in assert_called_with calls
Diffstat (limited to 'mock.py')
-rw-r--r-- | mock.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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): |