Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:

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')]

----------
nosy: +cjw296, mariocj89, xtreak
versions: +Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue28569>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to