Skip to content

Commit ac0d9cb

Browse files
committed
Remove error from the test again, fixed separately
1 parent 4e59a14 commit ac0d9cb

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

test-data/unit/check-typeguard.test

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -807,16 +807,16 @@ def test() -> None:
807807
[case testTypeGuardedTypeDoesNotLeak]
808808
# https://github.com/python/mypy/issues/18895
809809
from enum import Enum
810-
from typing import Union
811-
from typing_extensions import TypeGuard, Literal
810+
from typing import Literal, Union
811+
from typing_extensions import TypeGuard
812812

813813
class Model(str, Enum):
814-
MODEL_A1 = 'model_a1'
815-
MODEL_A2 = 'model_a2'
816-
MODEL_B = 'model_b'
814+
A1 = 'model_a1'
815+
A2 = 'model_a2'
816+
B = 'model_b'
817817

818-
MODEL_A = Literal[Model.MODEL_A1, Model.MODEL_A2]
819-
MODEL_B = Literal[Model.MODEL_B]
818+
MODEL_A = Literal[Model.A1, Model.A2]
819+
MODEL_B = Literal[Model.B]
820820

821821
def is_model_a(model: str) -> TypeGuard[MODEL_A]:
822822
return True
@@ -829,7 +829,6 @@ def process_model(model: Union[MODEL_A, MODEL_B]) -> int:
829829

830830
def handle(model: Model) -> int:
831831
if is_model_a(model) or is_model_b(model):
832-
# TODO: should start passing after #18896
833-
return process_model(model) # E: Argument 1 to "process_model" has incompatible type "Model"; expected "Union[Literal[Model.MODEL_A1, Model.MODEL_A2], Literal[Model.MODEL_B]]"
832+
return process_model(model)
834833
return 0
835834
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)