Skip to content

Commit

Permalink
Add test cases for RUF006 with lambdas (#13628)
Browse files Browse the repository at this point in the history
As discussed in #13619
  • Loading branch information
zanieb authored Oct 4, 2024
1 parent 888930b commit 020f4d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/ruff_linter/resources/test/fixtures/ruff/RUF006.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,9 @@ def f():
global task
loop = asyncio.get_event_loop()
task = loop.create_task(main()) # Error

# OK
# The task is returned by the lambda
f = lambda *args: asyncio.create_task(foo())
f = lambda *args: lambda *args: asyncio.create_task(foo())
f = lambda *args: [asyncio.create_task(foo()) for x in args]

0 comments on commit 020f4d4

Please sign in to comment.