[New-bugs-announce] [issue28735] Mock is equal to ANY but MagicMock is not

Rafael Jacinto Caricio da Fonseca report at bugs.python.org
Fri Nov 18 11:07:14 EST 2016


New submission from Rafael Jacinto Caricio da Fonseca:

On Python 3.5.2 mock.Mock() is equal to mock.ANY, but mock.MagicMock() is not.

Minimal example:

In Python 3.5.2:
>>> from unittest import mock
>>> mock.Mock() == mock.ANY
True
>>> mock.ANY == mock.Mock()
True
>>> mock.MagicMock() == mock.ANY
False
>>> mock.ANY == mock.MagicMock()
True

----------
components: Library (Lib)
messages: 281135
nosy: rafael.fonseca
priority: normal
severity: normal
status: open
title: Mock is equal to ANY but MagicMock is not
type: behavior
versions: Python 3.5

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


More information about the New-bugs-announce mailing list