@@ -199,6 +199,7 @@ EnumLiteralAlias3 = Literal[SomeEnum.AVALUE] | None
199199[typing fixtures/typing-full.pyi]
200200
201201[case testPEP695GenericTypeAlias]
202+ import sys
202203from typing import Callable
203204from types import GenericAlias
204205
@@ -208,24 +209,36 @@ type A[T] = list[T]
208209
209210def test_generic_alias() -> None:
210211 assert type(A[str]) is GenericAlias
211- assert str(A[str]) == "A[str]"
212+ if sys.version_info >= (3, 15): # type: ignore[operator]
213+ assert str(A[str]) == "_frozen_importlib.A[str]"
214+ else:
215+ assert str(A[str]) == "A[str]"
212216 assert str(getattr(A, "__value__")) == "list[T]"
213217
214218type B[T, S] = dict[S, T]
215219
216220def test_generic_alias_with_two_args() -> None:
217- assert str(B[str, int]) == "B[str, int]"
221+ if sys.version_info >= (3, 15): # type: ignore[operator]
222+ assert str(B[str, int]) == "_frozen_importlib.B[str, int]"
223+ else:
224+ assert str(B[str, int]) == "B[str, int]"
218225 assert str(getattr(B, "__value__")) == "dict[S, T]"
219226
220227type C[*Ts] = tuple[*Ts]
221228
222229def test_type_var_tuple_type_alias() -> None:
223- assert str(C[int, str]) == "C[int, str]"
230+ if sys.version_info >= (3, 15): # type: ignore[operator]
231+ assert str(C[int, str]) == "_frozen_importlib.C[int, str]"
232+ else:
233+ assert str(C[int, str]) == "C[int, str]"
224234 assert str(getattr(C, "__value__")) == "tuple[typing.Unpack[Ts]]"
225235
226236type D[**P] = Callable[P, int]
227237
228238def test_param_spec_type_alias() -> None:
229- assert str(D[[int, str]]) == "D[[int, str]]"
239+ if sys.version_info >= (3, 15): # type: ignore[operator]
240+ assert str(D[[int, str]]) == "_frozen_importlib.D[[int, str]]"
241+ else:
242+ assert str(D[[int, str]]) == "D[[int, str]]"
230243 assert str(getattr(D, "__value__")) == "typing.Callable[P, int]"
231244[typing fixtures/typing-full.pyi]
0 commit comments