Skip to content

Commit

Permalink
[ruff] Issue astral-sh#9951, RUF029: ruff format the RUF029.py fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
plredmond committed Apr 15, 2024
1 parent 503c468 commit ff5023e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crates/ruff_linter/resources/test/fixtures/ruff/RUF029.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
import time
import asyncio

async def pass_case(): # OK: awaits a coroutine

async def pass_case(): # OK: awaits a coroutine
print("hello")
await asyncio.sleep(1)
print("world")

async def fail_case(): # RUF029

async def fail_case(): # RUF029
print("hello")
time.sleep(1)
print("world")


async def pass_case_2(): # OK: uses an async context manager
async def pass_case_2(): # OK: uses an async context manager
async with None as i:
pass

async def fail_case_2(): # RUF029

async def fail_case_2(): # RUF029
with None as i:
pass


async def pass_case_3(): # OK: uses an async loop
async def pass_case_3(): # OK: uses an async loop
async for i in []:
pass

async def fail_case_3(): # RUF029

async def fail_case_3(): # RUF029
for i in []:
pass

0 comments on commit ff5023e

Please sign in to comment.