[issue39082] AsyncMock is unable to correctly patch static or class methods

2020-01-26 Thread Chris Withers
Chris Withers added the comment: New changeset 19be85c76503535c101b38194d282187de0ff631 by Chris Withers (Matthew Kokotovich) in branch '3.8': [3.8] bpo-39082: Allow AsyncMock to correctly patch static/class methods (GH-18190) https://github.com/python/cpython/commit/19be85c76503535c101b3819

[issue39082] AsyncMock is unable to correctly patch static or class methods

2020-01-25 Thread Matt Kokotovich
Change by Matt Kokotovich : -- pull_requests: +17573 pull_request: https://github.com/python/cpython/pull/18190 ___ Python tracker ___ _

[issue39082] AsyncMock is unable to correctly patch static or class methods

2020-01-25 Thread Chris Withers
Change by Chris Withers : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue39082] AsyncMock is unable to correctly patch static or class methods

2020-01-25 Thread Chris Withers
Chris Withers added the comment: New changeset 62865f4532094017a9b780b704686ca9734bc329 by Chris Withers (Matthew Kokotovich) in branch 'master': bpo-39082: Allow AsyncMock to correctly patch static/class methods (GH-18116) https://github.com/python/cpython/commit/62865f4532094017a9b780b70468

[issue39082] AsyncMock is unable to correctly patch static or class methods

2020-01-22 Thread Matt Kokotovich
Matt Kokotovich added the comment: I'd love to see this issue resolved, as it is keeping me from being able to switch to 3.8. I have a PR with Karthikeyan's suggestion, as I agree it makes more sense and could apply to more cases: https://github.com/python/cpython/pull/18116 -- __

[issue39082] AsyncMock is unable to correctly patch static or class methods

2020-01-22 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +17503 pull_request: https://github.com/python/cpython/pull/18116 ___ Python tracker ___ ___

[issue39082] AsyncMock is unable to correctly patch static or class methods

2020-01-20 Thread Matt Kokotovich
Change by Matt Kokotovich : -- nosy: +mkokotovich ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue39082] AsyncMock is unable to correctly patch static or class methods

2019-12-27 Thread Aniket Panse
Change by Aniket Panse : -- keywords: +patch pull_requests: +17162 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17717 ___ Python tracker ___ ___

[issue39082] AsyncMock is unable to correctly patch static or class methods

2019-12-18 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Found Raymond's answer on the difference between __dict__ and attribute lookup regarding descriptors to be useful here : https://stackoverflow.com/a/44600603 -- ___ Python tracker

[issue39082] AsyncMock is unable to correctly patch static or class methods

2019-12-17 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: There seems to be a difference in obtaining the attribute out of the __dict__ and getattr. patch uses __dict__ [0] to access the attribute to be patched and falls back to getattr. There is a difference in detecting normal attribute access to be a c

[issue39082] AsyncMock is unable to correctly patch static or class methods

2019-12-17 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Using patch as a function just returns a patch object. You need to call start method on the patch object to return a Mock. -- nosy: +lisroach, xtreak ___ Python tracker

[issue39082] AsyncMock is unable to correctly patch static or class methods

2019-12-17 Thread Aniket Panse
New submission from Aniket Panse : Currently, patch is unable to correctly patch coroutinefunctions decorated with `@staticmethod` or `@classmethod`. Example: ``` [*] aniketpanse [~/git/cpython] -> ./python