python-trio / flake8-async

Highly opinionated linter for Trio code
https://flake8-async.readthedocs.io
MIT License
17 stars 2 forks source link

False alarm `TRIO900` when async context manager defined inside an async function #133

Closed Zac-HD closed 1 year ago

Zac-HD commented 1 year ago
from contextlib import asynccontextmanager

async def this_is_not_an_async_generator():  # False alarm: TRIO900 on this line
    @asynccontextmanager
    async def cm():
        yield

    async with cm():
        pass