diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-03-27 21:30:40 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-03-27 21:30:40 (GMT) |
commit | 5a6c018b57d3c9fa9ac67809f5745d88971d5aca (patch) | |
tree | 2d3178f6fd97125f6f2849ffa9e06f618dd8f625 /Lib/unittest/mock.py | |
parent | f841909f092e4c7e17f1673cc7f0d9b535542a60 (diff) | |
parent | ce913877e42b7fa03434c2e765ace891e0f5c4dc (diff) | |
download | cpython-5a6c018b57d3c9fa9ac67809f5745d88971d5aca.zip cpython-5a6c018b57d3c9fa9ac67809f5745d88971d5aca.tar.gz cpython-5a6c018b57d3c9fa9ac67809f5745d88971d5aca.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.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 50ff949..7400fb7 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -2047,6 +2047,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='()') |