-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new check ASYNC251 for time.sleep()
- Loading branch information
Showing
6 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# NOAUTOFIX | ||
|
||
import time | ||
from time import sleep | ||
|
||
|
||
async def foo(): | ||
time.sleep(5) if 5 else None # ASYNC251: 8, "trio" | ||
time.sleep(5) # ASYNC251: 4, "trio" | ||
|
||
# Not handled due to difficulty tracking imports and not wanting to trigger | ||
# false positives. But could definitely be handled by ruff et al. | ||
sleep(5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# BASE_LIBRARY trio | ||
# NOASYNCIO # tests asyncio without replacing for it | ||
import trio | ||
import time | ||
import asyncio | ||
|
||
|
||
async def foo(): | ||
time.sleep(5) # ASYNC251: 4, "[trio/asyncio]" |