[issue28735] Mock is equal to ANY but MagicMock is not

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +952 ___ Python tracker ___ ___

[issue28735] Mock is equal to ANY but MagicMock is not

2017-01-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Berker. Maybe _Call.__eq__ also should return NotImplemented in some cases, but I don't have a demonstrating example. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___

[issue28735] Mock is equal to ANY but MagicMock is not

2017-01-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 442eb26b1ca4 by Serhiy Storchaka in branch '3.5': Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY. https://hg.python.org/cpython/rev/442eb26b1ca4 New changeset 4a38781538f7 by Serhiy Storchaka in branch '3.6': Issue #28735:

[issue28735] Mock is equal to ANY but MagicMock is not

2017-01-20 Thread Berker Peksag
Berker Peksag added the comment: Serhiy's patch looks pretty good to me, thanks! Also, thanks for the report, Rafael. I definitely forgot to fix this case after fixing issue 25195. -- stage: patch review -> commit review ___ Python tracker

[issue28735] Mock is equal to ANY but MagicMock is not

2017-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch fixes comparing MagicMock with ANY. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file46361/magicmock_eq.patch ___ Python tracker

[issue28735] Mock is equal to ANY but MagicMock is not

2017-01-20 Thread Kushal Das
Kushal Das added the comment: Now I understood, thanks. I think I should have more coffee before commenting on bugs :) -- ___ Python tracker ___

[issue28735] Mock is equal to ANY but MagicMock is not

2017-01-20 Thread Xiang Zhang
Xiang Zhang added the comment: Kushal I think the OP is reporting `mock.MagicMock() == mock.ANY` is False while `mock.ANY == mock.MagicMock()` is True which is still the case in 3.7. A related issue is #25195. In that issue Serhiy has mentioned this

[issue28735] Mock is equal to ANY but MagicMock is not

2017-01-20 Thread Kushal Das
Kushal Das added the comment: >From a checkout in last week. Python 3.7.0a0 (default:c163a76163f7, Jan 15 2017, 22:20:24) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from unittest import mock >>> mock.ANY ==

[issue28735] Mock is equal to ANY but MagicMock is not

2016-11-18 Thread SilentGhost
Changes by SilentGhost : -- nosy: +michael.foord versions: +Python 3.6, Python 3.7 ___ Python tracker ___

[issue28735] Mock is equal to ANY but MagicMock is not

2016-11-18 Thread Rafael Jacinto Caricio da Fonseca
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() ==