diff --git a/test-data/unit/check-python38.test b/test-data/unit/check-python38.test index 6e21104c3d16..deded7a52f72 100644 --- a/test-data/unit/check-python38.test +++ b/test-data/unit/check-python38.test @@ -210,7 +210,7 @@ h(arg=0) # E: Unexpected keyword argument "arg" for "h" i(arg=0) # E: Unexpected keyword argument "arg" [case testWalrus] -# flags: --strict-optional +# flags: --strict-optional --python-version 3.8 from typing import NamedTuple, Optional, List from typing_extensions import Final @@ -385,6 +385,7 @@ reveal_type(z2) # E: Name "z2" is not defined # N: Revealed type is "Any" [builtins fixtures/isinstancelist.pyi] [case testWalrusConditionalTypeBinder] +# flags: --python-version 3.8 from typing import Union from typing_extensions import Literal @@ -405,7 +406,7 @@ else: [builtins fixtures/property.pyi] [case testWalrusConditionalTypeCheck] -# flags: --strict-optional +# flags: --strict-optional --python-version 3.8 from typing import Optional maybe_str: Optional[str] @@ -421,6 +422,7 @@ reveal_type(maybe_str) # N: Revealed type is "Union[builtins.str, None]" [builtins fixtures/bool.pyi] [case testWalrusConditionalTypeCheck2] +# flags: --python-version 3.8 from typing import Optional maybe_str: Optional[str] @@ -436,6 +438,7 @@ reveal_type(maybe_str) # N: Revealed type is "Union[builtins.str, None]" [builtins fixtures/bool.pyi] [case testWalrusPartialTypes] +# flags: --python-version 3.8 from typing import List def check_partial_list() -> None: @@ -452,7 +455,7 @@ def check_partial_list() -> None: [builtins fixtures/list.pyi] [case testWalrusAssignmentAndConditionScopeForLiteral] -# flags: --warn-unreachable +# flags: --warn-unreachable --python-version 3.8 if (x := 0): reveal_type(x) # E: Statement is unreachable @@ -462,7 +465,7 @@ else: reveal_type(x) # N: Revealed type is "builtins.int" [case testWalrusAssignmentAndConditionScopeForProperty] -# flags: --warn-unreachable +# flags: --warn-unreachable --python-version 3.8 from typing_extensions import Literal @@ -490,7 +493,7 @@ reveal_type(y) # N: Revealed type is "Literal[False]" [builtins fixtures/property.pyi] [case testWalrusAssignmentAndConditionScopeForFunction] -# flags: --warn-unreachable +# flags: --warn-unreachable --python-version 3.8 from typing_extensions import Literal @@ -523,6 +526,7 @@ reveal_type(z) # N: Revealed type is "Literal[False]" [builtins fixtures/tuple.pyi] [case testWalrusExpr] +# flags: --python-version 3.8 def func() -> None: foo = Foo() if x := foo.x: @@ -533,6 +537,7 @@ class Foo: self.x = 123 [case testWalrusTypeGuard] +# flags: --python-version 3.8 from typing_extensions import TypeGuard def is_float(a: object) -> TypeGuard[float]: pass def main(a: object) -> None: @@ -542,6 +547,7 @@ def main(a: object) -> None: [builtins fixtures/tuple.pyi] [case testWalrusRedefined] +# flags: --python-version 3.8 def foo() -> None: x = 0 [x := x + y for y in [1, 2, 3]]