Skip to content

Commit dd193a6

Browse files
committed
okay tests
1 parent 3086342 commit dd193a6

7 files changed

Lines changed: 11 additions & 9 deletions

test-data/unit/check-custom-plugin.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ class M(type):
996996
attr = 'test'
997997

998998
class B:
999-
attr = None
999+
attr = b'bytes'
10001000

10011001
class Cls(B, metaclass=M):
10021002
pass

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
540+
x = None # E: Need type annotation for "x" (hint: "x: <type> | None = ...") [var-annotated]
541+
541542

542543
[case testErrorCodeRedundantCast]
543544
# flags: --warn-redundant-casts

test-data/unit/check-expressions.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +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: "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: Need type annotation for "z" (hint: "z: <type> | None = ...") \
1559+
# E: "append" of "list" does not return a value (it only ever returns None)
15591560
[builtins fixtures/list.pyi]
15601561

15611562
[case testConditionalExpressionWithUnreachableBranches]

test-data/unit/check-functions.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,7 +2622,7 @@ reveal_type(bar(None)) # N: Revealed type is "None"
26222622
[out]
26232623

26242624
[case testNoComplainInferredNone]
2625-
# flags: --no-strict-optional
2625+
# flags: --no-strict-optional --no-local-partial-types
26262626
from typing import TypeVar, Optional
26272627
T = TypeVar('T')
26282628
def X(val: T) -> T: ...
@@ -2635,7 +2635,7 @@ xx: Optional[int] = X(x_in)
26352635
from typing import TypeVar, Optional
26362636
T = TypeVar('T')
26372637
def X(val: T) -> T: ...
2638-
x_in = None
2638+
x_in = X(None)
26392639
def Y(x: Optional[str] = X(x_in)): ...
26402640

26412641
xx: Optional[int] = X(x_in)

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
1000+
none2 = None # E: Need type annotation for "none2" (hint: "none2: <type> | 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
1029+
d = None # E: Need type annotation for "d" (hint: "d: <type> | 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-redefine2.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ if int():
10641064
x = ""
10651065

10661066
[file b.py]
1067-
# mypy: allow-redefinition-new
1067+
# mypy: local-partial-types=false, allow-redefinition-new
10681068
x = 0
10691069
if int():
10701070
x = ""

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
957+
for x in None, None: pass # E: Need type annotation for "x" (hint: "x: <type> | None = ...")
958958
[builtins fixtures/for.pyi]
959959

960960
[case testForLoopOverTupleAndSubtyping]

0 commit comments

Comments
 (0)