-
-
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.
Handle more edge cases with if and try block imports.
* Test mypy against Python 3.8 not 3.6
- Loading branch information
1 parent
db801a4
commit 37d71bc
Showing
6 changed files
with
139 additions
and
8 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
10 changes: 10 additions & 0 deletions
10
tests/test_flake8_dunder_all_/test_check_and_add_all_if_TYPE_CHECKING_else_._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,10 @@ | ||
|
||
if False or sys.version_info < (3, 7): | ||
import foo | ||
else: | ||
import bar | ||
|
||
__all__ = ["a_function"] | ||
|
||
|
||
def a_function(): ... |
13 changes: 13 additions & 0 deletions
13
tests/test_flake8_dunder_all_/test_check_and_add_all_if_TYPE_CHECKING_try_._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,13 @@ | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
try: | ||
from x import y | ||
except ImportError: | ||
pass | ||
|
||
__all__ = ["a_function"] | ||
|
||
|
||
def a_function(): ... |
15 changes: 15 additions & 0 deletions
15
tests/test_flake8_dunder_all_/test_check_and_add_all_if_TYPE_CHECKING_try_finally_._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 @@ | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
try: | ||
from x import y | ||
except ImportError: | ||
pass | ||
finally: | ||
pass | ||
|
||
__all__ = ["a_function"] | ||
|
||
|
||
def a_function(): ... |