Back to all fixes
CuratedPython 3.12local
RuntimeWarning: coroutine 'x' was never awaited
Problem
Calling an `async def` function without awaiting it does nothing and warns 'coroutine was never awaited'.
Solution
python
Await it inside an async function (`await foo()`), or run it from sync code with `asyncio.run(foo())`. To run several concurrently, `await asyncio.gather(a(), b())`. Calling `foo()` alone only creates a coroutine object — it doesn't execute until it's awaited or scheduled.