Type aliases should not have a signature

This commit is contained in:
Dave Halter
2021-01-01 03:59:28 +01:00
parent 4f34712858
commit 778442a972
2 changed files with 5 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ class X:
('import contextlib\n@contextlib.contextmanager\ndef f(x): pass\nf(', 'f(x)'),
# typing lib
('from typing import cast\ncast(', {
'cast(typ: object, val: Any) -> Any',
'cast(typ: str, val: Any) -> Any',
@@ -112,6 +113,7 @@ class X:
('from typing import TypeVar\nTypeVar(',
'TypeVar(name: str, *constraints: Type[Any], bound: Union[None, Type[Any], str]=..., '
'covariant: bool=..., contravariant: bool=...)'),
('from typing import List\nList(', None),
]
)
def test_tree_signature(Script, environment, code, expected):