-
-
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 testing of from contextlib import *
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
tests/autofix_files/exception_suppress_context_manager_import_star.py
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,16 @@ | ||
# ARG --enable=ASYNC910 | ||
# see exception_suppress_context_manager.py for main testing | ||
|
||
# AUTOFIX | ||
# ASYNCIO_NO_AUTOFIX | ||
|
||
from contextlib import * | ||
|
||
# NOTE: remove in #255 | ||
import trio | ||
|
||
|
||
async def foo(): # ASYNC910: 0, "exit", Statement('function definition', lineno) | ||
with suppress(): | ||
await foo() | ||
await trio.lowlevel.checkpoint() |
7 changes: 7 additions & 0 deletions
7
tests/autofix_files/exception_suppress_context_manager_import_star.py.diff
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,7 @@ | ||
--- | ||
+++ | ||
@@ x,3 x,4 @@ | ||
async def foo(): # ASYNC910: 0, "exit", Statement('function definition', lineno) | ||
with suppress(): | ||
await foo() | ||
+ await trio.lowlevel.checkpoint() |
15 changes: 15 additions & 0 deletions
15
tests/eval_files/exception_suppress_context_manager_import_star.py
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,15 @@ | ||
# ARG --enable=ASYNC910 | ||
# see exception_suppress_context_manager.py for main testing | ||
|
||
# AUTOFIX | ||
# ASYNCIO_NO_AUTOFIX | ||
|
||
from contextlib import * | ||
|
||
# NOTE: remove in #255 | ||
import trio | ||
|
||
|
||
async def foo(): # ASYNC910: 0, "exit", Statement('function definition', lineno) | ||
with suppress(): | ||
await foo() |