Skip to content

Commit 57535da

Browse files
authored
Fix type alias unpacking syntax in tests
Updated type alias test cases to reflect syntax changes in Python 3.11.
1 parent 740cdb1 commit 57535da

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

test-data/unit/check-type-aliases.test

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,10 @@ from typing import TypeVarTuple, Unpack
12451245
Ts = TypeVarTuple('Ts')
12461246
TA: TypeAlias = tuple[Unpack[Ts]]
12471247

1248-
v1: TA[*list[int]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1248+
v1: TA[*list[int]]
1249+
# python3.10: Invalid syntax; you likely need to run mypy using Python 3.11 or newer
1250+
# E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1251+
12491252
v2: TA[Unpack[list[int]]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
12501253
[builtins fixtures/tuple.pyi]
12511254

@@ -1257,7 +1260,10 @@ from typing import TypeVarTuple, Unpack
12571260
Ts = TypeVarTuple('Ts')
12581261
TA: TypeAlias = tuple[Unpack[Ts]]
12591262

1260-
v1: TA[*list[int]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1263+
v1: TA[*list[int]]
1264+
# python3.10: Invalid syntax
1265+
# E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1266+
12611267
v2: TA[Unpack[list[int]]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
12621268
[builtins fixtures/tuple.pyi]
12631269

0 commit comments

Comments
 (0)