The instances of mock.Mock() are equal to mock.ANY, but mock.MagicMock() instances are not.
Minimal example:
In Python 3.5.2 (or mock 2.0.0):
>>> from unittest import mock
>>> mock.Mock() == mock.ANY
True
>>> mock.ANY == mock.Mock()
True
>>> mock.MagicMock() == mock.ANY
False
>>> mock.ANY == mock.MagicMock()
True
I have opened an issue in the official Python tracker, but probably here is the most appropriated place to that. Please let me know if I should close it and just leave this one here.
ref: http://bugs.python.org/issue28735
The instances of
mock.Mock()are equal tomock.ANY, butmock.MagicMock()instances are not.Minimal example:
In Python 3.5.2 (or mock 2.0.0):
I have opened an issue in the official Python tracker, but probably here is the most appropriated place to that. Please let me know if I should close it and just leave this one here.
ref: http://bugs.python.org/issue28735