mirror of https://github.com/astral-sh/ruff
Add test cases for `RUF006` with lambdas (#13628)
As discussed in https://github.com/astral-sh/ruff/issues/13619
This commit is contained in:
parent
888930b7d3
commit
020f4d4a54
|
|
@ -185,3 +185,9 @@ def f():
|
||||||
global task
|
global task
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
task = loop.create_task(main()) # Error
|
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]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue