[issue32972] unittest.TestCase coroutine support

R. David Murray report at bugs.python.org
Wed Feb 28 14:16:35 EST 2018


R. David Murray <rdmurray at bitdance.com> added the comment:

In order for this to be actually useful, I think we also need a mechanism to set up and run async cleanup methods.  In my own project I accomplish this by putting the run_until_complete in a try/finally loop and have an asyncAddCleanup method that just appends coroutines to a list that are then run in reversed order in the finally clause.

Whatever we come up with needs tests and docs, and before that, I'm sure, more discussion about the API.  Probably a topic for python-ideas?  Or the testing sig?

I really do think we should have async test support in the stdlib, though.  Basic support isn't that hard (it's 15 lines in the test suite I'm using currently).

----------
nosy: +r.david.murray
type: behavior -> enhancement
versions:  -Python 3.6, Python 3.7

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


More information about the Python-bugs-list mailing list