Skip to content

Commit a1654cc

Browse files
committed
fix tests
1 parent 7423456 commit a1654cc

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

test-data/unit/check-expressions.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,18 +437,18 @@ class D(Iterable[A]):
437437
[builtins fixtures/bool.pyi]
438438

439439
[case testNonBooleanContainsReturnValue]
440-
a, b, c = None, None, None # type: (A, bool, int)
440+
a, b, c = None, None, None # type: (A, bool, str)
441441
if int():
442442
b = a not in a
443443
if int():
444444
b = a in a
445445
if int():
446-
c = a not in a # E: Incompatible types in assignment (expression has type "bool", variable has type "int")
446+
c = a not in a # E: Incompatible types in assignment (expression has type "bool", variable has type "str")
447447
if int():
448-
c = a in a # E: Incompatible types in assignment (expression has type "bool", variable has type "int")
448+
c = a in a # E: Incompatible types in assignment (expression has type "bool", variable has type "str")
449449

450450
class A:
451-
def __contains__(self, x: 'A') -> int: pass
451+
def __contains__(self, x: 'A') -> str: pass
452452
[builtins fixtures/bool.pyi]
453453

454454
[case testInWithInvalidArgs]

test-data/unit/check-unreachable-code.test

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -619,24 +619,25 @@ if MYPY or mypy_only:
619619
# flags: --always-false COMPILE_TIME_FALSE
620620
from typing import Literal
621621

622-
indeterminate: bool
622+
indeterminate: str
623623
COMPILE_TIME_FALSE: Literal[True] # type-narrowing: mapped in 'if' only
624624
a = COMPILE_TIME_FALSE or indeterminate
625-
reveal_type(a) # N: Revealed type is "builtins.bool"
625+
reveal_type(a) # N: Revealed type is "builtins.str"
626626
b = indeterminate or COMPILE_TIME_FALSE
627-
reveal_type(b) # N: Revealed type is "Union[builtins.bool, Literal[True]]"
627+
reveal_type(b) # N: Revealed type is "Union[builtins.str, Literal[True]]"
628628
[builtins fixtures/bool.pyi]
629629
[typing fixtures/typing-medium.pyi]
630630

631631
[case testSemanticAnalysisTrueButTypeNarrowingFalse]
632632
# flags: --always-true COMPILE_TIME_TRUE
633-
indeterminate: bool
634-
COMPILE_TIME_TRUE: None # type narrowed to `else` only
633+
indeterminate: str
634+
COMPILE_TIME_TRUE: Literal[False] # type narrowed to `else` only
635635
a = COMPILE_TIME_TRUE or indeterminate
636-
reveal_type(a) # N: Revealed type is "None"
636+
reveal_type(a) # N: Revealed type is "Literal[False]"
637637
b = indeterminate or COMPILE_TIME_TRUE
638-
reveal_type(b) # N: Revealed type is "Union[builtins.bool, None]"
638+
reveal_type(b) # N: Revealed type is "Union[builtins.str, Literal[False]]"
639639

640+
[typing fixtures/typing-medium.pyi]
640641
[case testConditionalAssertWithoutElse]
641642
import typing
642643

test-data/unit/lib-stub/enum.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Flag(Enum):
3838
def __bool__(self) -> bool: ...
3939

4040

41-
class IntFlag(Flag):
41+
class IntFlag(int, Flag):
4242
def __and__(self: _T, other: Union[int, _T]) -> _T: pass
4343

4444

0 commit comments

Comments
 (0)