Skip to content

Commit 923d496

Browse files
committed
Fix test_semanal to ignore typing.py from output.
1 parent f426800 commit 923d496

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

TEST.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from mypy.typing import TypedDict
2+
Point = TypedDict('Point', {'x': int, 'y': int})
3+
point = dict(x=42, y=1337) # type: Point
4+
5+
6+
"""
7+
from typing import TYPE_CHECKING
8+
if TYPE_CHECKING:
9+
from typing import TypedDict
10+
else:
11+
TypedDict = lambda name, fields: dict
12+
Point = TypedDict('Point', {'x': int, 'y': int})
13+
point = dict(x=42, y=1337) # type: Point
14+
"""

mypy/test/testsemanal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def test_semanal(testcase):
7878
# TODO the test is not reliable
7979
if (not f.path.endswith((os.sep + 'builtins.pyi',
8080
'typing.pyi',
81+
'typing.py',
8182
'abc.pyi',
8283
'collections.pyi'))
8384
and not os.path.basename(f.path).startswith('_')

0 commit comments

Comments
 (0)