await-outside-async / E1142#

Message emitted:

'await' should be used within an async function

Description:

Emitted when await is used outside an async function.

Correct code:

import asyncio


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

Problematic code:

import asyncio


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

Related links:

Created by the typecheck checker.