-
-
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.
* doc updates. don't trigger on open_nursery in 102 (it didn't work anyway). async112 error message now specifies if its nursery or taskgroup. * update tests * help repro coverage bug * Revert "help repro coverage bug" This reverts commit 2cf2519. * updates after review. add test cases. type tracker can now handle attribute targets.
- Loading branch information
Showing
13 changed files
with
173 additions
and
39 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
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
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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
# mypy: disable-error-code="arg-type" | ||
# ARG --startable-in-context-manager=my_startable | ||
from contextlib import asynccontextmanager | ||
|
||
import anyio | ||
|
||
|
||
async def my_startable( | ||
task_status: anyio.abc.TaskStatus[object] = anyio.TASK_STATUS_IGNORED, | ||
): | ||
task_status.started() | ||
await anyio.lowlevel.checkpoint() | ||
|
||
|
||
@asynccontextmanager | ||
async def foo(): | ||
# create_task_group only exists in anyio | ||
async with anyio.create_task_group() as bar_tg: | ||
bar_tg.start_soon(my_startable) # ASYNC113: 8 | ||
# false alarm - anyio.run_process is not startable | ||
bar_tg.start_soon(anyio.run_process) # ASYNC113: 8 | ||
yield | ||
yield |
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,17 @@ | ||
# BASE_LIBRARY asyncio | ||
# ARG --startable-in-context-manager=bar | ||
# TRIO_NO_ERROR | ||
# ANYIO_NO_ERROR | ||
|
||
from contextlib import asynccontextmanager | ||
import asyncio | ||
|
||
|
||
async def bar(): ... | ||
|
||
|
||
@asynccontextmanager | ||
async def my_cm(): | ||
async with asyncio.TaskGroup() as tg: # type: ignore[attr-defined] | ||
tg.create_task(bar) # ASYNC113: 8 | ||
yield |
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