Message 415527 - Python tracker (original) (raw)
Sometimes asyncio.run() is not enough.
For example, unittest test case needs to call several async functions (setup, test, teardown) from the synchronous code using the same execution context and event loop.
The proposal provides the following:
with Runner() as runner: runner.run(async_func())