Skip to content

Commit aed1acd

Browse files
committed
add --warn-return-any flags to the new test cases - just in case
1 parent d3957d0 commit aed1acd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test-data/unit/check-overloading.test

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6854,7 +6854,9 @@ reveal_type(headers) # N: Revealed type is "Union[__main__.Headers, typing.Iter
68546854
[builtins fixtures/isinstancelist.pyi]
68556855

68566856
[case testReturnNotImplementedInBinaryMagicMethods]
6857+
# flags: --warn-return-any
68576858
from typing import Union
6859+
68586860
class A:
68596861
def __add__(self, other: object) -> int:
68606862
return NotImplemented
@@ -6868,18 +6870,20 @@ class A:
68686870
def __mul__(self, other: object) -> Union[int, NotImplementedType]:
68696871
x: Union[int, NotImplementedType]
68706872
return x
6871-
68726873
[builtins fixtures/notimplemented.pyi]
68736874

68746875
[case testReturnNotImplementedABCSubclassHookMethod]
6876+
# flags: --warn-return-any
68756877
class A:
68766878
@classmethod
68776879
def __subclasshook__(cls, t: type[object], /) -> bool:
68786880
return NotImplemented
68796881
[builtins fixtures/notimplemented.pyi]
68806882

68816883
[case testReturnNotImplementedInNormalMethods]
6884+
# flags: --warn-return-any
68826885
from typing import Union
6886+
68836887
class A:
68846888
def f(self) -> bool: return NotImplemented # E: Incompatible return value type (got "_NotImplementedType", expected "bool")
68856889
def g(self) -> NotImplementedType: return True # E: Incompatible return value type (got "bool", expected "_NotImplementedType")
@@ -6889,7 +6893,7 @@ class A:
68896893
[builtins fixtures/notimplemented.pyi]
68906894

68916895
[case testNotImplementedReturnedFromBinaryMagicMethod]
6892-
# flags: --warn-unreachable
6896+
# flags: --warn-return-any
68936897
from typing import Union
68946898

68956899
class A:
@@ -6940,5 +6944,4 @@ reveal_type(a <= 1) # N: Revealed type is "builtins.bool"
69406944
reveal_type(a < 1) # N: Revealed type is "Any"
69416945
reveal_type(a and int()) # N: Revealed type is "Union[__main__.A, builtins.int]"
69426946
reveal_type(int() or a) # N: Revealed type is "Union[builtins.int, __main__.A]"
6943-
69446947
[builtins fixtures/notimplemented.pyi]

0 commit comments

Comments
 (0)