This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author felixonmars
Recipients felixonmars
Date 2015-09-20.10:27:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442744840.41.0.232215932607.issue25195@psf.upfronthosting.co.za>
In-reply-to
Content
Since Python 3.5.0 mock.MagicMock() object seems not matched by mock.ANY. This behavior looks weird and breaks tests of boto.

Minimized example:

In Python 3.4.3:
>>> from unittest import mock
>>> m = mock.MagicMock()
>>> m(mock.MagicMock())
<MagicMock name='mock()' id='139728217270704'>
>>> m.assert_called_with(mock.ANY)
>>>

In Python 3.5.0:
>>> from unittest import mock
>>> m = mock.MagicMock()
>>> m(mock.MagicMock())
<MagicMock name='mock()' id='140093484276536'>
>>> m.assert_called_with(mock.ANY)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/unittest/mock.py", line 792, in assert_called_with
    raise AssertionError(_error_message()) from cause
AssertionError: Expected call: mock(<ANY>)
Actual call: mock(<MagicMock id='140093520206872'>)
History
Date User Action Args
2015-09-20 10:27:20felixonmarssetrecipients: + felixonmars
2015-09-20 10:27:20felixonmarssetmessageid: <1442744840.41.0.232215932607.issue25195@psf.upfronthosting.co.za>
2015-09-20 10:27:20felixonmarslinkissue25195 messages
2015-09-20 10:27:20felixonmarscreate