You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test-data/unit/check-flags.test
+8-12Lines changed: 8 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,8 @@
2
2
# flags: --disallow-untyped-defs
3
3
def f(x): pass
4
4
[out]
5
-
main:2: error: Function is missing a return type annotation
6
-
main:2: note: Use "-> None" if function does not return a value
7
5
main:2: error: Function is missing a type annotation
6
+
main:2: note: Use "-> None" if function does not return a value
8
7
9
8
[case testUnannotatedArgumentSingle]
10
9
# flags: --disallow-untyped-defs
@@ -33,7 +32,7 @@ def f() -> int: return 1
33
32
# flags: --disallow-untyped-defs
34
33
def f(): return 5
35
34
[out]
36
-
main:2: error: Function is missing a return type annotation
35
+
main:2: error: Function is missing a type annotation
37
36
38
37
[case testUnannotatedReturn]
39
38
# flags: --disallow-untyped-defs
@@ -57,27 +56,25 @@ lambda x: x
57
56
def f():
58
57
1 + "str"
59
58
[out]
60
-
main:2: error: Function is missing a return type annotation
59
+
main:2: error: Function is missing a type annotation
61
60
main:2: note: Use "-> None" if function does not return a value
62
61
63
62
[case testUnannotatedReturnWithOnlySelfArgument]
64
63
# flags: --disallow-untyped-defs
65
64
def f(self): pass
66
65
[out]
67
-
main:2: error: Function is missing a return type annotation
68
-
main:2: note: Use "-> None" if function does not return a value
69
66
main:2: error: Function is missing a type annotation
67
+
main:2: note: Use "-> None" if function does not return a value
70
68
71
69
[case testUnannotatedReturnWithNontrivialReturn]
72
70
# flags: --disallow-untyped-defs
73
71
def f(): return 1
74
72
[out]
75
-
main:2: error: Function is missing a return type annotation
73
+
main:2: error: Function is missing a type annotation
76
74
77
75
[case testUntypedAsyncDef]
78
76
# flags: --disallow-untyped-defs
79
-
async def f(): # E: Function is missing a return type annotation \
80
-
# N: Use "-> None" if function does not return a value
77
+
async def f(): # E: Function is missing a type annotation # N: Use "-> None" if function does not return a value
81
78
pass
82
79
[builtins fixtures/async_await.pyi]
83
80
[typing fixtures/typing-medium.pyi]
@@ -105,7 +102,6 @@ async def g(x: int) -> Any:
105
102
def get_tasks(self):
106
103
return 'whatever'
107
104
[out]
108
-
main:2: error: Function is missing a return type annotation
109
105
main:2: error: Function is missing a type annotation
110
106
111
107
[case testDisallowUntypedDefsUntypedDecorator]
@@ -2323,13 +2319,13 @@ ignore_errors = True
2323
2319
# flags: --config-file tmp/mypy.ini
2324
2320
import x, y, z
2325
2321
[file x.py]
2326
-
def f(a): ... # E: Function is missing a return type annotation # N: Use "-> None" if function does not return a value # E: Function is missing a type annotation
2322
+
def f(a): ... # E: Function is missing a type annotation # N: Use "-> None" if function does not return a value
2327
2323
def g(a: int) -> int: return f(a)
2328
2324
[file y.py]
2329
2325
def f(a): pass
2330
2326
def g(a: int) -> int: return f(a)
2331
2327
[file z.py]
2332
-
def f(a): pass # E: Function is missing a return type annotation # N: Use "-> None" if function does not return a value # E: Function is missing a type annotation
2328
+
def f(a): pass # E: Function is missing a type annotation # N: Use "-> None" if function does not return a value
2333
2329
def g(a: int) -> int: return f(a) # E: Call to untyped function "f" in typed context
0 commit comments