Skip to content

Commit 9f89b9e

Browse files
committed
tests
1 parent 718c199 commit 9f89b9e

6 files changed

Lines changed: 9 additions & 8 deletions

File tree

mypyc/test-data/run-classes.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4295,7 +4295,7 @@ from __future__ import annotations
42954295

42964296
from mypy_extensions import mypyc_attr
42974297

4298-
a = []
4298+
a: list[int] = []
42994299

43004300
@mypyc_attr(free_list_len=1)
43014301
class Foo:

mypyc/test-data/run-tuples.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def test_final_tuple_not_in() -> None:
339339

340340
assert 'x' not in TUP0
341341

342-
log = []
342+
log: list[str] = []
343343

344344
def f_a() -> str:
345345
log.append('f_a')

test-data/unit/check-errorcodes.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ d: D = {'x': 1, 'y': 2} # type: ignore[typeddict-item]
537537
y = x # E: Cannot determine type of "x" [has-type] \
538538
# E: Name "x" is used before definition [used-before-def]
539539
reveal_type(y) # N: Revealed type is "Any"
540-
x = None # E: Need type annotation for "x" (hint: "x: <type> | None = ...") [var-annotated]
540+
x = None
541+
541542

542543

543544
[case testErrorCodeRedundantCast]

test-data/unit/check-expressions.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,8 +1555,8 @@ from typing import List, Union
15551555
x = []
15561556
y = ""
15571557
x.append(y) if bool() else x.append(y)
1558-
z = x.append(y) if bool() else x.append(y) # E: Need type annotation for "z" (hint: "z: <type> | None = ...") \
1559-
# E: "append" of "list" does not return a value (it only ever returns None)
1558+
z = x.append(y) if bool() else x.append(y) # E: "append" of "list" does not return a value (it only ever returns None)
1559+
15601560
[builtins fixtures/list.pyi]
15611561

15621562
[case testConditionalExpressionWithUnreachableBranches]

test-data/unit/check-literal.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ bool2 = True
997997
bool3: bool = True
998998

999999
none1: Literal[None] = None
1000-
none2 = None # E: Need type annotation for "none2" (hint: "none2: <type> | None = ...")
1000+
none2 = None
10011001
none3: None = None
10021002

10031003
reveal_type(int1) # N: Revealed type is "Literal[1]"
@@ -1026,7 +1026,7 @@ combined: Literal[1, "foo", True, None]
10261026
a = 1
10271027
b = "foo"
10281028
c = True
1029-
d = None # E: Need type annotation for "d" (hint: "d: <type> | None = ...")
1029+
d = None
10301030

10311031
w = a # E: Incompatible types in assignment (expression has type "int", variable has type "Literal[1]")
10321032
x = b # E: Incompatible types in assignment (expression has type "str", variable has type "Literal['foo']")

test-data/unit/check-tuples.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ for x in t: pass # E: Need type annotation for "x"
954954

955955
[case testForLoopOverNoneValuedTuple]
956956
import typing
957-
for x in None, None: pass # E: Need type annotation for "x" (hint: "x: <type> | None = ...")
957+
for x in None, None: pass
958958
[builtins fixtures/for.pyi]
959959

960960
[case testForLoopOverTupleAndSubtyping]

0 commit comments

Comments
 (0)