-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[flake8_async
] Fix sleep argument name for anyio (ASYNC115
, ASYNC116
)
#18262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flake8_async
] Fix sleep argument name for anyio (ASYNC115
, ASYNC116
)
#18262
Conversation
Would you mind filling in the summary and test plan section of your PR? It would help us review your change |
Apologies for the delay — I got caught up with work and wasn’t able to write the tests or summary yet. I’ll update it shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks and also thank you for updating the summary. It helped me a lot to this PR a lot!
I think we should change the added tests because they currently wouldn't catch a regression (they're all okay). I think it's as easy as changing the argument provided to sleep
/delay
to 0
(which makes the rule trigger).
done @MichaReiser thank you very much for the review, have updated the tests. |
|
flake8_async
] Fix sleep argument name for anyio (ASYNC115
, ASYNC116
)
#18164
Summary
Fix incorrect argument name detection for
anyio.sleep
andtrio.sleep
in ASYNC115 lint check.The linter previously assumed the keyword argument for sleep duration was always
seconds
, causing false positives whendelay
was used withanyio.sleep
.This update correctly distinguishes between
seconds
(Trio) anddelay
(AnyIO), improving accuracy.Fixes #18164
Test Plan
anyio.sleep(delay=0)
andtrio.sleep(seconds=0)
usage.