Skip to content

Commit 9b37a71

Browse files
committed
fix tests, removing some redundant tests
1 parent 3498e85 commit 9b37a71

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

test-data/unit/check-optional.test

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -119,32 +119,15 @@ x = f() # E: Function does not return a value
119119
def f(x: None) -> None: pass
120120
f(None)
121121

122-
[case testInferOptionalFromDefaultNone]
123-
def f(x: int = None) -> None:
124-
x + 1 # E: Unsupported left operand type for + (some union)
125-
f(None)
126-
[out]
127-
128-
[case testInferOptionalFromDefaultNoneWithFastParser]
129-
130-
def f(x: int = None) -> None:
131-
x + 1 # E: Unsupported left operand type for + (some union)
132-
f(None)
133-
[out]
134-
135-
[case testInferOptionalFromDefaultNoneComment]
136-
def f(x=None):
137-
# type: (int) -> None
138-
x + 1 # E: Unsupported left operand type for + (some union)
139-
f(None)
122+
[case testNoInferOptionalFromDefaultNone]
123+
def f(x: int = None) -> None: # E: Incompatible types in assignment (expression has type None, variable has type "int")
124+
pass
140125
[out]
141126

142-
[case testInferOptionalFromDefaultNoneCommentWithFastParser]
143-
144-
def f(x=None):
127+
[case testNoInferOptionalFromDefaultNoneComment]
128+
def f(x=None): # E: Incompatible types in assignment (expression has type None, variable has type "int")
145129
# type: (int) -> None
146-
x + 1 # E: Unsupported left operand type for + (some union)
147-
f(None)
130+
pass
148131
[out]
149132

150133
[case testInferOptionalType]

0 commit comments

Comments
 (0)