Skip to content

Commit 246f194

Browse files
committed
Fix tests
1 parent 1961565 commit 246f194

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

test-data/unit/check-classes.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5217,10 +5217,10 @@ x: TD
52175217
x1 = TD({'x': []})
52185218
y: NM
52195219
y1 = NM(x=[])
5220-
reveal_type(x) # N: Revealed type is "TypedDict('__main__.TD', {'x': builtins.list[Any]})"
5221-
reveal_type(x1) # N: Revealed type is "TypedDict('__main__.TD', {'x': builtins.list[Any]})"
5222-
reveal_type(y) # N: Revealed type is "Tuple[builtins.list[Any], fallback=__main__.NM]"
5223-
reveal_type(y1) # N: Revealed type is "Tuple[builtins.list[Any], fallback=__main__.NM]"
5220+
reveal_type(x) # N: Revealed type is "TypedDict('__main__.TD', {'x': builtins.list[builtins.int]})"
5221+
reveal_type(x1) # N: Revealed type is "TypedDict('__main__.TD', {'x': builtins.list[builtins.int]})"
5222+
reveal_type(y) # N: Revealed type is "Tuple[builtins.list[builtins.int], fallback=__main__.NM]"
5223+
reveal_type(y1) # N: Revealed type is "Tuple[builtins.list[builtins.int], fallback=__main__.NM]"
52245224
[builtins fixtures/dict.pyi]
52255225
[out]
52265226

test-data/unit/check-errorcodes.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ class E(Generic[S, T]): pass
410410

411411
x: C[object] # E: Value of type variable "T" of "C" cannot be "object" [type-var]
412412
y: D[int] # E: Type argument "int" of "D" must be a subtype of "str" [type-var]
413-
z: D[int, int] # E: "D" expects 1 type argument, but 2 given [type-arg]
413+
z: D[int, int] # E: "D" expects 1 type argument, but 2 given [type-arg] \
414+
# E: Type argument "int" of "D" must be a subtype of "str" [type-var]
414415

415416
def h(a: TT, s: S) -> None:
416417
b: C[TT] # E: Invalid type argument value for "C" [type-var]

test-data/unit/check-newsemanal.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ c2: C[int, str] # E: "C" expects 1 type argument, but 2 given
553553
c3: C
554554
c = C('') # E: Argument 1 to "C" has incompatible type "str"; expected "int"
555555
reveal_type(c.get()) # N: Revealed type is "builtins.int"
556-
reveal_type(c2) # N: Revealed type is "__main__.C[Any]"
556+
reveal_type(c2) # N: Revealed type is "__main__.C[builtins.int]"
557557
reveal_type(c3) # N: Revealed type is "__main__.C[Any]"
558558
[case testNewAnalyzerGenericsTypeVarForwardRef]
559559
from typing import TypeVar, Generic
@@ -1817,8 +1817,8 @@ def func(x: List[C[T]]) -> T:
18171817
x: A
18181818
A = List[C[int, str]] # E: "C" expects 1 type argument, but 2 given
18191819

1820-
reveal_type(x) # N: Revealed type is "builtins.list[__main__.C[Any]]"
1821-
reveal_type(func(x)) # N: Revealed type is "Any"
1820+
reveal_type(x) # N: Revealed type is "builtins.list[__main__.C[builtins.int]]"
1821+
reveal_type(func(x)) # N: Revealed type is "builtins.int"
18221822

18231823

18241824
[builtins fixtures/list.pyi]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,8 +959,8 @@ A = List[int, str] | int # E: "list" expects 1 type argument, but 2 given
959959
B = int | list[int, str] # E: "list" expects 1 type argument, but 2 given
960960
a: A
961961
b: B
962-
reveal_type(a) # N: Revealed type is "Union[builtins.list[Any], builtins.int]"
963-
reveal_type(b) # N: Revealed type is "Union[builtins.int, builtins.list[Any]]"
962+
reveal_type(a) # N: Revealed type is "Union[builtins.list[builtins.int], builtins.int]"
963+
reveal_type(b) # N: Revealed type is "Union[builtins.int, builtins.list[builtins.int]]"
964964

965965
[case testValidTypeAliasValues]
966966
from typing import TypeVar, Generic, List

0 commit comments

Comments
 (0)