@@ -84,7 +84,7 @@ async def f() -> int:
84
84
x = await g()
85
85
return x
86
86
[out]
87
- main:7: error: Incompatible types in await (actual type Generator[int, None, str], expected type Awaitable[Any])
87
+ main:7: error: Incompatible types in await (actual type " Generator[int, None, str]" , expected type " Awaitable[Any]" )
88
88
89
89
[case testAwaitIteratorError]
90
90
@@ -95,7 +95,7 @@ async def f() -> int:
95
95
x = await g()
96
96
return x
97
97
[out]
98
- main:6: error: Incompatible types in await (actual type Iterator[Any], expected type Awaitable[Any])
98
+ main:6: error: Incompatible types in await (actual type " Iterator[Any]" , expected type " Awaitable[Any]" )
99
99
100
100
[case testAwaitArgumentError]
101
101
@@ -106,7 +106,7 @@ async def f() -> int:
106
106
return x
107
107
[builtins fixtures/async_await.pyi]
108
108
[out]
109
- main:5: error: Incompatible types in await (actual type "int", expected type Awaitable[Any])
109
+ main:5: error: Incompatible types in await (actual type "int", expected type " Awaitable[Any]" )
110
110
111
111
[case testAwaitResultError]
112
112
@@ -150,7 +150,7 @@ async def f() -> None:
150
150
[builtins fixtures/async_await.pyi]
151
151
[out]
152
152
main:4: error: AsyncIterable expected
153
- main:4: error: List[int] has no attribute "__aiter__"
153
+ main:4: error: " List[int]" has no attribute "__aiter__"
154
154
155
155
[case testAsyncForTypeComments]
156
156
@@ -232,13 +232,13 @@ async def wrong_iterable(obj: Iterable[int]):
232
232
233
233
[out]
234
234
main:18: error: AsyncIterable expected
235
- main:18: error: Iterable[int] has no attribute "__aiter__"; maybe "__iter__"?
235
+ main:18: error: " Iterable[int]" has no attribute "__aiter__"; maybe "__iter__"?
236
236
main:19: error: Iterable expected
237
- main:19: error: asyncify[int] has no attribute "__iter__"; maybe "__aiter__"?
237
+ main:19: error: " asyncify[int]" has no attribute "__iter__"; maybe "__aiter__"?
238
238
main:20: error: AsyncIterable expected
239
- main:20: error: Iterable[int] has no attribute "__aiter__"; maybe "__iter__"?
239
+ main:20: error: " Iterable[int]" has no attribute "__aiter__"; maybe "__iter__"?
240
240
main:21: error: Iterable expected
241
- main:21: error: asyncify[int] has no attribute "__iter__"; maybe "__aiter__"?
241
+ main:21: error: " asyncify[int]" has no attribute "__iter__"; maybe "__aiter__"?
242
242
[builtins fixtures/async_await.pyi]
243
243
244
244
[case testAsyncWith]
@@ -271,7 +271,7 @@ class C:
271
271
def __aenter__(self) -> int: pass
272
272
async def __aexit__(self, x, y, z) -> None: pass
273
273
async def f() -> None:
274
- async with C() as x: # E: Incompatible types in "async with" for __aenter__ (actual type "int", expected type Awaitable[Any])
274
+ async with C() as x: # E: Incompatible types in "async with" for __aenter__ (actual type "int", expected type " Awaitable[Any]" )
275
275
pass
276
276
[builtins fixtures/async_await.pyi]
277
277
[out]
@@ -282,7 +282,7 @@ class C:
282
282
def __aenter__(self) -> None: pass
283
283
async def __aexit__(self, x, y, z) -> None: pass
284
284
async def f() -> None:
285
- async with C() as x: # E: None has no attribute "__await__"
285
+ async with C() as x: # E: " None" has no attribute "__await__"
286
286
pass
287
287
[builtins fixtures/async_await.pyi]
288
288
[out]
@@ -293,7 +293,7 @@ class C:
293
293
async def __aenter__(self) -> int: pass
294
294
def __aexit__(self, x, y, z) -> int: pass
295
295
async def f() -> None:
296
- async with C() as x: # E: Incompatible types in "async with" for __aexit__ (actual type "int", expected type Awaitable[Any])
296
+ async with C() as x: # E: Incompatible types in "async with" for __aexit__ (actual type "int", expected type " Awaitable[Any]" )
297
297
pass
298
298
[builtins fixtures/async_await.pyi]
299
299
[out]
@@ -304,7 +304,7 @@ class C:
304
304
async def __aenter__(self) -> int: pass
305
305
def __aexit__(self, x, y, z) -> None: pass
306
306
async def f() -> None:
307
- async with C() as x: # E: None has no attribute "__await__"
307
+ async with C() as x: # E: " None" has no attribute "__await__"
308
308
pass
309
309
[builtins fixtures/async_await.pyi]
310
310
[out]
@@ -362,7 +362,7 @@ def g() -> Generator[Any, None, str]:
362
362
return x
363
363
[builtins fixtures/async_await.pyi]
364
364
[out]
365
- main:6: error: "yield from" can't be applied to Awaitable[str]
365
+ main:6: error: "yield from" can't be applied to " Awaitable[str]"
366
366
367
367
[case testAwaitableSubclass]
368
368
@@ -523,7 +523,7 @@ def h() -> None:
523
523
524
524
[out]
525
525
main:9: error: Iterable expected
526
- main:9: error: AsyncGenerator[int, None] has no attribute "__iter__"; maybe "__aiter__"?
526
+ main:9: error: " AsyncGenerator[int, None]" has no attribute "__iter__"; maybe "__aiter__"?
527
527
528
528
[case testAsyncGeneratorNoYieldFrom]
529
529
# flags: --fast-parser --python-version 3.6
@@ -607,19 +607,19 @@ def plain_host_generator() -> Generator[str, None, None]:
607
607
yield 'a'
608
608
x = 0
609
609
x = yield from plain_generator()
610
- x = yield from plain_coroutine() # E: "yield from" can't be applied to Awaitable[int]
610
+ x = yield from plain_coroutine() # E: "yield from" can't be applied to " Awaitable[int]"
611
611
x = yield from decorated_generator()
612
- x = yield from decorated_coroutine() # E: "yield from" can't be applied to AwaitableGenerator[Any, Any, int, Awaitable[int]]
612
+ x = yield from decorated_coroutine() # E: "yield from" can't be applied to " AwaitableGenerator[Any, Any, int, Awaitable[int]]"
613
613
x = yield from other_iterator()
614
614
x = yield from other_coroutine() # E: "yield from" can't be applied to "Aw"
615
615
616
616
async def plain_host_coroutine() -> None:
617
617
x = 0
618
- x = await plain_generator() # E: Incompatible types in await (actual type Generator[str, None, int], expected type Awaitable[Any])
618
+ x = await plain_generator() # E: Incompatible types in await (actual type " Generator[str, None, int]" , expected type " Awaitable[Any]" )
619
619
x = await plain_coroutine()
620
620
x = await decorated_generator()
621
621
x = await decorated_coroutine()
622
- x = await other_iterator() # E: Incompatible types in await (actual type "It", expected type Awaitable[Any])
622
+ x = await other_iterator() # E: Incompatible types in await (actual type "It", expected type " Awaitable[Any]" )
623
623
x = await other_coroutine()
624
624
625
625
@coroutine
@@ -636,11 +636,11 @@ def decorated_host_generator() -> Generator[str, None, None]:
636
636
@coroutine
637
637
async def decorated_host_coroutine() -> None:
638
638
x = 0
639
- x = await plain_generator() # E: Incompatible types in await (actual type Generator[str, None, int], expected type Awaitable[Any])
639
+ x = await plain_generator() # E: Incompatible types in await (actual type " Generator[str, None, int]" , expected type " Awaitable[Any]" )
640
640
x = await plain_coroutine()
641
641
x = await decorated_generator()
642
642
x = await decorated_coroutine()
643
- x = await other_iterator() # E: Incompatible types in await (actual type "It", expected type Awaitable[Any])
643
+ x = await other_iterator() # E: Incompatible types in await (actual type "It", expected type " Awaitable[Any]" )
644
644
x = await other_coroutine()
645
645
646
646
[builtins fixtures/async_await.pyi]
0 commit comments