[issue32972] unittest.TestCase coroutine support

Yury Selivanov report at bugs.python.org
Tue Mar 6 14:38:08 EST 2018


Yury Selivanov <yselivanov at gmail.com> added the comment:

> Doesn't that break when, for example, test methods are decorated with unittest.mock.patch?

No, it shouldn't break them if you wrap async methods carefully.

Here's a metaclass that I wrote recently doing just that: https://github.com/Azure/azure-functions-python-worker/blob/9ed3f8acd45a264927ce11af64f5b495f0404032/azure/worker/testutils.py#L44-L63

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32972>
_______________________________________


More information about the Python-bugs-list mailing list