mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00

## Summary Update the name of `ASYNC110` to match [upstream](https://flake8-async.readthedocs.io/en/latest/rules.html). Also update to the functionality to match upstream by adding support for `asyncio` and `anyio` (gated behind preview). Part of https://github.com/astral-sh/ruff/issues/12039. ## Test Plan Added tests for `asyncio` and `anyio`
48 lines
637 B
Python
48 lines
637 B
Python
import trio
|
|
import anyio
|
|
import asyncio
|
|
|
|
|
|
async def func():
|
|
while True:
|
|
await trio.sleep(10)
|
|
|
|
|
|
async def func():
|
|
while True:
|
|
await trio.sleep_until(10)
|
|
|
|
|
|
async def func():
|
|
while True:
|
|
trio.sleep(10)
|
|
|
|
|
|
async def func():
|
|
while True:
|
|
await anyio.sleep(10)
|
|
|
|
|
|
async def func():
|
|
while True:
|
|
await anyio.sleep_until(10)
|
|
|
|
|
|
async def func():
|
|
while True:
|
|
anyio.sleep(10)
|
|
|
|
|
|
async def func():
|
|
while True:
|
|
await asyncio.sleep(10)
|
|
|
|
|
|
async def func():
|
|
while True:
|
|
await asyncio.sleep_until(10)
|
|
|
|
|
|
async def func():
|
|
while True:
|
|
asyncio.sleep(10)
|