ruff/crates/ruff_linter/resources/test/fixtures/flake8_async/ASYNC110.py
Auguste Lalande 855d62cdde
[flake8-async] Update ASYNC110 to match upstream (#12261)
## 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`
2024-07-09 17:17:28 -07:00

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)