Martin Richard

Results 60 comments of Martin Richard

Thanks for the report. Do you mean that someting like ``isinstance(my_coro_mock(), collections.abc.Coroutine)`` should be ``True``? It seems that Python itself doesn't enforce this with decorated functions: import collections.abc, asyncio @asyncio.coroutine...

MagicMock is not awaitable, and the value returned by the call to __aenter__ is unspecified, thus returns a MagicMock. You need to tell to the mock of SomeAsyncClass what to...

``CoroutineMock`` should be named ``CoroutineFunctionMock``. ``inspect.isawaitable(my_coro_mock()) # True``. This is intended.

Yes, this is because CoroutineMock() is the mock of a coroutine function, which is not awaitable. async def my_coro(): ... # do something inspect.isawaitable(my_coro) # False inspect.isawaitable(my_coro()) # True and...

Re-opening to add unit tests to ensure CoroutineMock is tested against inspect.isawaitable().

I've yet to find a way to generate the warning without breaking anything: The function breaks isinstance(m, CoroutineMock) but a subclass would break isinstance(ASubClassOfCoroutineFunctionMock, CoroutineMock), while it shouldn't.

I tried different things and I gave up triggering the warning when the symbol is accessed, this will be too complex for a very small benefit. ``CoroutineMock = CoroutineFunctionMock`` is...

Hi, Thanks for you pull-requests. I'll try to review them tomorrow or Friday.

Thanks for all your PRs. Unfortunately this one will not work as it is, because ``test/__init__.py`` imports all modules of the package so they're discovered when running ``python -m unittest...

Hi, currently the target is python 3.4 until its EOL (2019-03-16), but this may change if the support of this version becomes a problem with future changes in the language.