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 xtreak
Recipients anfedorov, cjw296, mariocj89, michael.foord, shmed, xtreak
Date 2019-07-17.11:50:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1563364246.76.0.484532866122.issue28569@roundup.psfhosted.org>
In-reply-to
Content
Is this similar to issue21478? Michael, can you please confirm this behavior and the change proposed in issue21478?

I tried out the below program as per initial report

# foo.py

from unittest.mock import patch, Mock
p = patch('requests.get', autospec=True)
manager = Mock()
manager.attach_mock(p.start(), 'requests_get')

import requests
requests.get('https://google.com')
print(manager.mock_calls)
p.stop()
print(manager.mock_calls)

# Without patch

$ python.exe foo.py
[]
[]

# With PR 14688 in issue21478

$ python.exe foo.py
[call.requests_get('https://google.com')]
[call.requests_get('https://google.com')]
History
Date User Action Args
2019-07-17 11:50:46xtreaksetrecipients: + xtreak, cjw296, michael.foord, anfedorov, shmed, mariocj89
2019-07-17 11:50:46xtreaksetmessageid: <1563364246.76.0.484532866122.issue28569@roundup.psfhosted.org>
2019-07-17 11:50:46xtreaklinkissue28569 messages
2019-07-17 11:50:46xtreakcreate