Skip to content

Commit 8e3bd76

Browse files
committed
Test more
1 parent 2bcfac9 commit 8e3bd76

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

test-data/unit/exportjson.test

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def foo(a: int) -> None: ...
210210
[case testExportDifferentTypes]
211211
from __future__ import annotations
212212

213-
from typing import Callable, Any, Literal
213+
from typing import Callable, Any, Literal, NoReturn
214214

215215
list_ann: list[int]
216216
any_ann: Any
@@ -220,6 +220,40 @@ callable_ann: Callable[[int], str]
220220
type_type_ann: type[int]
221221
literal_ann: Literal['x', 5, False]
222222

223+
def f() -> NoReturn:
224+
assert False
225+
226+
BadType = 1
227+
x: BadType # type: ignore
228+
229+
[builtins fixtures/tuple.pyi]
230+
[out]
231+
<not checked>
232+
233+
[case testExportGenericTypes]
234+
from __future__ import annotations
235+
236+
from typing import TypeVar, Callable
237+
from typing_extensions import TypeVarTuple, ParamSpec, Unpack, Concatenate
238+
239+
T = TypeVar("T")
240+
241+
def ident(x: T) -> T:
242+
return x
243+
244+
Ts = TypeVarTuple("Ts")
245+
246+
def ts(t: tuple[Unpack[Ts]]) -> tuple[Unpack[Ts]]:
247+
return t
248+
249+
P = ParamSpec("P")
250+
251+
def pspec(f: Callable[P, None], *args: P.args, **kwargs: P.kwargs) -> None:
252+
f(*args, **kwargs)
253+
254+
def concat(f: Callable[Concatenate[int, P], None], *args: P.args, **kwargs: P.kwargs) -> None:
255+
f(1, *args, **kwargs)
256+
223257
[builtins fixtures/tuple.pyi]
224258
[out]
225259
<not checked>
@@ -228,7 +262,6 @@ literal_ann: Literal['x', 5, False]
228262
import typing
229263

230264
from typing import overload, TypeVar
231-
from typing_extensions import TypeVarTuple, ParamSpec
232265

233266
@overload
234267
def f(x: int) -> int: ...
@@ -247,9 +280,6 @@ def foo(x: int) -> int: ...
247280
X = int
248281
x: X = 2
249282

250-
Ts = TypeVarTuple("Ts")
251-
P = ParamSpec("P")
252-
253283
[builtins fixtures/tuple.pyi]
254284
[out]
255285
<not checked>

0 commit comments

Comments
 (0)