Message358601
Currently, patch is unable to correctly patch coroutinefunctions decorated with `@staticmethod` or `@classmethod`.
Example:
```
[*] aniketpanse [~/git/cpython] -> ./python ±[master]
Python 3.9.0a1+ (heads/master:50d4f12958, Dec 17 2019, 16:31:30)
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Helper:
... @classmethod
... async def async_class_method(cls):
... pass
...
>>> from unittest.mock import patch
>>> patch("Helper.async_class_method")
<unittest.mock._patch object at 0x7fc28ddbbf40>
```
This should ideally return an `AsyncMock()`. |
|
Date |
User |
Action |
Args |
2019-12-18 00:36:45 | czardoz | set | recipients:
+ czardoz, asvetlov, yselivanov |
2019-12-18 00:36:45 | czardoz | set | messageid: <1576629405.73.0.979234563097.issue39082@roundup.psfhosted.org> |
2019-12-18 00:36:45 | czardoz | link | issue39082 messages |
2019-12-18 00:36:45 | czardoz | create | |
|