PY-16055 Add quickfix and tests for functions with incorrect return annotation

Add quickfix for functions whose return type doesn't match their annotated type.
This commit is contained in:
Lada Gagina
2016-08-30 17:12:55 +03:00
parent dd95592ff4
commit c9a96f59ff
10 changed files with 143 additions and 4 deletions
@@ -0,0 +1,3 @@
def f(x):
# type: (int) -> str
return <warning descr="Expected type 'str', got 'int' instead">42<caret></warning>
@@ -0,0 +1,3 @@
def f(x):
# type: (int) -> int
return 42
@@ -0,0 +1,2 @@
def f(x) -> str:
return <warning descr="Expected type 'str', got 'int' instead">42<caret></warning>
@@ -0,0 +1,2 @@
def f(x) -> int:
return 42