blob: ab6d68929f8e888e6ebd294026734eb0636a7537 [file] [log] [blame] [edit]
[case testTupleLowercaseSettingOff]
# flags: --python-version 3.9 --force-uppercase-builtins
x = (3,)
x = 3 # E: Incompatible types in assignment (expression has type "int", variable has type "Tuple[int]")
[builtins fixtures/tuple.pyi]
[case testTupleLowercaseSettingOn]
# flags: --python-version 3.9 --no-force-uppercase-builtins
x = (3,)
x = 3 # E: Incompatible types in assignment (expression has type "int", variable has type "tuple[int]")
[builtins fixtures/tuple.pyi]
[case testListLowercaseSettingOff]
# flags: --python-version 3.9 --force-uppercase-builtins
x = [3]
x = 3 # E: Incompatible types in assignment (expression has type "int", variable has type "List[int]")
[case testListLowercaseSettingOn]
# flags: --python-version 3.9 --no-force-uppercase-builtins
x = [3]
x = 3 # E: Incompatible types in assignment (expression has type "int", variable has type "list[int]")
[case testDictLowercaseSettingOff]
# flags: --python-version 3.9 --force-uppercase-builtins
x = {"key": "value"}
x = 3 # E: Incompatible types in assignment (expression has type "int", variable has type "Dict[str, str]")
[case testDictLowercaseSettingOn]
# flags: --python-version 3.9 --no-force-uppercase-builtins
x = {"key": "value"}
x = 3 # E: Incompatible types in assignment (expression has type "int", variable has type "dict[str, str]")
[case testSetLowercaseSettingOff]
# flags: --python-version 3.9 --force-uppercase-builtins
x = {3}
x = 3 # E: Incompatible types in assignment (expression has type "int", variable has type "Set[int]")
[builtins fixtures/set.pyi]
[case testSetLowercaseSettingOn]
# flags: --python-version 3.9 --no-force-uppercase-builtins
x = {3}
x = 3 # E: Incompatible types in assignment (expression has type "int", variable has type "set[int]")
[builtins fixtures/set.pyi]
[case testTypeLowercaseSettingOff]
# flags: --python-version 3.9 --no-force-uppercase-builtins
x: type[type]
y: int
y = x # E: Incompatible types in assignment (expression has type "type[type]", variable has type "int")
[case testLowercaseSettingOnTypeAnnotationHint]
# flags: --python-version 3.9 --no-force-uppercase-builtins
x = [] # E: Need type annotation for "x" (hint: "x: list[<type>] = ...")
y = {} # E: Need type annotation for "y" (hint: "y: dict[<type>, <type>] = ...")
z = set() # E: Need type annotation for "z" (hint: "z: set[<type>] = ...")
[builtins fixtures/primitives.pyi]
[case testLowercaseSettingOnRevealTypeType]
# flags: --python-version 3.9 --no-force-uppercase-builtins
def f(t: type[int]) -> None:
reveal_type(t) # N: Revealed type is "type[builtins.int]"
reveal_type(f) # N: Revealed type is "def (t: type[builtins.int])"
[builtins fixtures/primitives.pyi]