await-outside-async / E1142ΒΆ

Message emitted:

'await' should be used within an async function

Description:

Emitted when await is used outside an async function.

Problematic code:

import asyncio


def main():
    await asyncio.sleep(1)  # [await-outside-async]

Correct code:

import asyncio


async def main():
    await asyncio.sleep(1)

Related links:

Created by the typecheck checker.