Andrew Plummer added the comment:

I've had a look and I think this could be because the class _Call (also in 
unittest.mock) has lost its __ne__ method between 3.4 and 3.5.

Compare
https://hg.python.org/cpython/file/v3.4.4/Lib/unittest/mock.py#l2010
with
https://hg.python.org/cpython/file/v3.5.1/Lib/unittest/mock.py#l2028

This leads me to this changeset:
https://hg.python.org/cpython/rev/3603bae63c13


My failing test:

from unittest import mock

call1 = mock.call(mock.MagicMock())
call2 = mock.call(mock.ANY)

assert call1 == call2
assert not (call1 != call2)

This passes in 3.4 but fails in 3.5, but fails on the second assert, not the 
first. So they are equal, but they're not not-equal. I've added this as a test 
and reinstated __ne__ in my patch.

----------
keywords: +patch
nosy: +Andrew Plummer
Added file: http://bugs.python.org/file41844/fix_mock_call_ne.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25195>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to