Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
out version
  • Loading branch information
hauntsaninja committed Jul 1, 2023
commit 5259f195bc749e4f66c3e2b35533e8d7d2cf122c
4 changes: 0 additions & 4 deletions test-data/unit/check-columns.test
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,6 @@ f(g(
))
x[0]
[out]
main:2:10:2:10: error: Incompatible types in assignment (expression has type "str", variable has type "int")
main:6:3:6:3: error: Argument 1 to "f" has incompatible type "int"; expected "str"
main:8:1:8:1: error: Value of type "int" is not indexable
[out version>=3.8]
main:2:10:2:17: error: Incompatible types in assignment (expression has type "str", variable has type "int")
main:6:3:7:1: error: Argument 1 to "f" has incompatible type "int"; expected "str"
main:8:1:8:4: error: Value of type "int" is not indexable
7 changes: 0 additions & 7 deletions test-data/unit/check-parameter-specification.test
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,6 @@ def f2(c: Callable[P, R]) -> Callable[Concatenate[int, P], R]:
f2(lambda x: 42)(42, x=42)
[builtins fixtures/paramspec.pyi]
[out]
main:10: error: invalid syntax; you likely need to run mypy using Python 3.8 or newer
[out version>=3.8]
main:17: error: Incompatible return value type (got "Callable[[Arg(int, 'x'), **P], R]", expected "Callable[[int, **P], R]")
main:17: note: This is likely because "result" has named arguments: "x". Consider marking them positional-only

Expand All @@ -620,9 +618,6 @@ def f2(c: Callable[P, R]) -> Callable[Concatenate[int, P], R]:
# reason for rejection:
f2(lambda x: 42)(42, x=42)
[builtins fixtures/paramspec.pyi]
[out]
main:11: error: invalid syntax; you likely need to run mypy using Python 3.8 or newer
[out version>=3.8]

[case testParamSpecConcatenateWithTypeVar]
from typing_extensions import ParamSpec, Concatenate
Expand Down Expand Up @@ -662,8 +657,6 @@ reveal_type(abc)
bar(abc)
[builtins fixtures/paramspec.pyi]
[out]
main:13: error: invalid syntax; you likely need to run mypy using Python 3.8 or newer
[out version>=3.8]
main:16: note: Revealed type is "__main__.Foo[[builtins.int, b: builtins.str]]"

[case testSolveParamSpecWithSelfType]
Expand Down
4 changes: 0 additions & 4 deletions test-data/unit/check-typeguard.test
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,6 @@ def bad_typeguard(*, x: object) -> TypeGuard[int]: # line 15
[builtins fixtures/classmethod.pyi]
[out]
main:4: error: TypeGuard functions must have a positional argument
main:11: error: TypeGuard functions must have a positional argument
main:15: error: TypeGuard functions must have a positional argument
[out version>=3.8]
main:4: error: TypeGuard functions must have a positional argument
main:12: error: TypeGuard functions must have a positional argument
main:15: error: TypeGuard functions must have a positional argument

Expand Down
21 changes: 0 additions & 21 deletions test-data/unit/cmdline.test
Original file line number Diff line number Diff line change
Expand Up @@ -1122,19 +1122,6 @@ class AnotherCustomClassDefinedBelow:
def another_even_more_interesting_method(self, arg: Union[int, str, float]) -> None:
self.very_important_attribute_with_long_name: OneCustomClassName = OneCustomClassName().some_interesting_method(arg)
[out]
some_file.py:3: error: Unsupported operand types for + ("int" and "str")
42 + 'no way'
^
some_file.py:11: error: Incompatible types in assignment (expression has type
"AnotherCustomClassDefinedBelow", variable has type "OneCustomClassName")
...t_attribute_with_long_name: OneCustomClassName = OneCustomClassName()....
^
some_file.py:11: error: Argument 1 to "some_interesting_method" of
"OneCustomClassName" has incompatible type "Union[int, str, float]"; expected
"AnotherCustomClassDefinedBelow"
...OneCustomClassName = OneCustomClassName().some_interesting_method(arg)
^
[out version>=3.8]
some_file.py:3: error: Unsupported operand types for + ("int" and "str")
42 + 'no way'
^~~~~~~~
Expand Down Expand Up @@ -1165,14 +1152,6 @@ def test_tabs() -> str:
def test_between(x: str) -> None: ...
test_between(1 + 1)
[out]
tabs.py:2: error: Incompatible return value type (got "None", expected "str")
return None
^
tabs.py:4: error: Argument 1 to "test_between" has incompatible type "int";
expected "str"
test_between(1 + 1)
^
[out version>=3.8]
tabs.py:2: error: Incompatible return value type (got "None", expected "str")
return None
^~~~
Expand Down
10 changes: 0 additions & 10 deletions test-data/unit/fine-grained-blockers.test
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,6 @@ a.py:1: error: invalid syntax [syntax]
def f(x: int) ->
^
==
main:3: error: Missing positional argument "x" in call to "f" [call-arg]
a.f()
^
==
[out version>=3.8]
==
a.py:1: error: invalid syntax [syntax]
def f(x: int) ->
^
==
main:3: error: Missing positional argument "x" in call to "f" [call-arg]
a.f()
^~~~~
Expand Down
22 changes: 0 additions & 22 deletions test-data/unit/fine-grained.test
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ class A:
def g(self, a: A) -> None: pass
[out]
==
main:5: error: Missing positional argument "a" in call to "g" of "A" [call-arg]
a.g() # E
^
[out version>=3.8]
==
main:5: error: Missing positional argument "a" in call to "g" of "A" [call-arg]
a.g() # E
^~~~~
Expand Down Expand Up @@ -10101,23 +10096,6 @@ object + 1
1()

[out]
b.py:1: error: Unsupported left operand type for + ("Type[object]")
object + 1
^
a.py:1: error: Unsupported operand types for + ("int" and "str")
1 + ''
^
==
b.py:1: error: Unsupported left operand type for + ("Type[object]")
object + 1
^
b.py:2: error: "int" not callable
1()
^
a.py:1: error: Unsupported operand types for + ("int" and "str")
1 + ''
^
[out version>=3.8]
b.py:1: error: Unsupported left operand type for + ("Type[object]")
object + 1
^~~~~~~~~~
Expand Down
38 changes: 0 additions & 38 deletions test-data/unit/semanal-errors.test
Original file line number Diff line number Diff line change
Expand Up @@ -361,107 +361,81 @@ main:2: error: "yield" outside function
[case testInvalidLvalues1]
1 = 1
[out]
main:1: error: can't assign to literal
[out version>=3.8]
main:1: error: cannot assign to literal
[out version>=3.10]
main:1: error: cannot assign to literal here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues2]
(1) = 1
[out]
main:1: error: can't assign to literal
[out version>=3.8]
main:1: error: cannot assign to literal
[out version>=3.10]
main:1: error: cannot assign to literal here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues3]
(1, 1) = 1
[out]
main:1: error: can't assign to literal
[out version>=3.8]
main:1: error: cannot assign to literal

[case testInvalidLvalues4]
[1, 1] = 1
[out]
main:1: error: can't assign to literal
[out version>=3.8]
main:1: error: cannot assign to literal

[case testInvalidLvalues6]
x = y = z = 1 # ok
x, (y, 1) = 1
[out]
main:2: error: can't assign to literal
[out version>=3.8]
main:2: error: cannot assign to literal

[case testInvalidLvalues7]
x, [y, 1] = 1
[out]
main:1: error: can't assign to literal
[out version>=3.8]
main:1: error: cannot assign to literal

[case testInvalidLvalues8]
x, [y, [z, 1]] = 1
[out]
main:1: error: can't assign to literal
[out version>=3.8]
main:1: error: cannot assign to literal

[case testInvalidLvalues9]
x, (y) = 1 # ok
x, (y, (z, z)) = 1 # ok
x, (y, (z, 1)) = 1
[out]
main:3: error: can't assign to literal
[out version>=3.8]
main:3: error: cannot assign to literal

[case testInvalidLvalues10]
x + x = 1
[out]
main:1: error: can't assign to operator
[out version>=3.8]
main:1: error: cannot assign to operator
[out version>=3.10]
main:1: error: cannot assign to expression here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues11]
-x = 1
[out]
main:1: error: can't assign to operator
[out version>=3.8]
main:1: error: cannot assign to operator
[out version>=3.10]
main:1: error: cannot assign to expression here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues12]
1.1 = 1
[out]
main:1: error: can't assign to literal
[out version>=3.8]
main:1: error: cannot assign to literal
[out version>=3.10]
main:1: error: cannot assign to literal here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues13]
'x' = 1
[out]
main:1: error: can't assign to literal
[out version>=3.8]
main:1: error: cannot assign to literal
[out version>=3.10]
main:1: error: cannot assign to literal here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues14]
x() = 1
[out]
main:1: error: can't assign to function call
[out version>=3.8]
main:1: error: cannot assign to function call
[out version>=3.10]
main:1: error: cannot assign to function call here. Maybe you meant '==' instead of '='?
Expand Down Expand Up @@ -518,16 +492,12 @@ main:2: error: Can use starred expression only as assignment target
x = 1
del x(1)
[out]
main:2: error: can't delete function call
[out version>=3.8]
main:2: error: cannot delete function call

[case testInvalidDel2]
x = 1
del x + 1
[out]
main:2: error: can't delete operator
[out version>=3.8]
main:2: error: cannot delete operator
[out version>=3.10]
main:2: error: cannot delete expression
Expand Down Expand Up @@ -927,8 +897,6 @@ import typing
def f(): pass
f() = 1 # type: int
[out]
main:3: error: can't assign to function call
[out version>=3.8]
main:3: error: cannot assign to function call
[out version>=3.10]
main:3: error: cannot assign to function call here. Maybe you meant '==' instead of '='?
Expand Down Expand Up @@ -1007,8 +975,6 @@ x, y = 1, 2 # type: int # E: Tuple type expected for multiple variables
a = 1
a() = None # type: int
[out]
main:2: error: can't assign to function call
[out version>=3.8]
main:2: error: cannot assign to function call
[out version>=3.10]
main:2: error: cannot assign to function call here. Maybe you meant '==' instead of '='?
Expand Down Expand Up @@ -1311,8 +1277,6 @@ main:2: note: Did you forget to import it from "typing"? (Suggestion: "from typi
def f(): pass
with f() as 1: pass
[out]
main:2: error: can't assign to literal
[out version>=3.8]
main:2: error: cannot assign to literal

[case testInvalidTypeAnnotation]
Expand All @@ -1327,8 +1291,6 @@ import typing
def f() -> None:
f() = 1 # type: int
[out]
main:3: error: can't assign to function call
[out version>=3.8]
main:3: error: cannot assign to function call
[out version>=3.10]
main:3: error: cannot assign to function call here. Maybe you meant '==' instead of '='?
Expand Down
2 changes: 0 additions & 2 deletions test-data/unit/semanal-statements.test
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,6 @@ MypyFile:1(
def f(x, y) -> None:
del x, y + 1
[out]
main:2: error: can't delete operator
[out version>=3.8]
main:2: error: cannot delete operator
[out version>=3.10]
main:2: error: cannot delete expression
Expand Down