Message348056
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')] |
|
Date |
User |
Action |
Args |
2019-07-17 11:50:46 | xtreak | set | recipients:
+ xtreak, cjw296, michael.foord, anfedorov, shmed, mariocj89 |
2019-07-17 11:50:46 | xtreak | set | messageid: <1563364246.76.0.484532866122.issue28569@roundup.psfhosted.org> |
2019-07-17 11:50:46 | xtreak | link | issue28569 messages |
2019-07-17 11:50:46 | xtreak | create | |
|