[issue24857] mock: Crash on comparing call_args with long strings

A Kaptur report at bugs.python.org
Fri Sep 4 06:24:09 CEST 2015


A Kaptur added the comment:

It looks like there's a related bug in call_args around __ne__:

>>> m = Mock()
>>> m(1,2)
<Mock name='mock()' id='4483976016'>
>>> m.call_args
call(1, 2)
>>> m.call_args == call(1,2)
True
>>> m.call_args != call(1,2)
True

Any reason not to define __ne__ as not __eq__? Otherwise it looks like you fall back to tuple.__ne__, which does the wrong thing here.

----------
nosy: +akaptur

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24857>
_______________________________________


More information about the Python-bugs-list mailing list