@@ -183,7 +183,6 @@ async def f() -> None:
183
183
[typing fixtures/typing-async.pyi]
184
184
185
185
[case testAsyncForComprehension]
186
- # flags: --python-version 3.6
187
186
from typing import Generic, Iterable, TypeVar, AsyncIterator, Tuple
188
187
189
188
T = TypeVar('T')
@@ -223,7 +222,6 @@ async def generatorexp(obj: Iterable[int]):
223
222
[typing fixtures/typing-async.pyi]
224
223
225
224
[case testAsyncForComprehensionErrors]
226
- # flags: --python-version 3.6
227
225
from typing import Generic, Iterable, TypeVar, AsyncIterator, Tuple
228
226
229
227
T = TypeVar('T')
@@ -240,16 +238,10 @@ class asyncify(Generic[T], AsyncIterator[T]):
240
238
raise StopAsyncIteration
241
239
242
240
async def wrong_iterable(obj: Iterable[int]):
243
- [i async for i in obj]
244
- [i for i in asyncify(obj)]
245
- {i: i async for i in obj}
246
- {i: i for i in asyncify(obj)}
247
-
248
- [out]
249
- main:18: error: "Iterable[int]" has no attribute "__aiter__" (not async iterable)
250
- main:19: error: "asyncify[int]" has no attribute "__iter__"; maybe "__aiter__"? (not iterable)
251
- main:20: error: "Iterable[int]" has no attribute "__aiter__" (not async iterable)
252
- main:21: error: "asyncify[int]" has no attribute "__iter__"; maybe "__aiter__"? (not iterable)
241
+ [i async for i in obj] # E: "Iterable[int]" has no attribute "__aiter__" (not async iterable)
242
+ [i for i in asyncify(obj)] # E: "asyncify[int]" has no attribute "__iter__"; maybe "__aiter__"? (not iterable)
243
+ {i: i async for i in obj} # E: "Iterable[int]" has no attribute "__aiter__" (not async iterable)
244
+ {i: i for i in asyncify(obj)} # E: "asyncify[int]" has no attribute "__iter__"; maybe "__aiter__"? (not iterable)
253
245
[builtins fixtures/async_await.pyi]
254
246
[typing fixtures/typing-async.pyi]
255
247
@@ -340,17 +332,6 @@ async def f() -> None:
340
332
[builtins fixtures/async_await.pyi]
341
333
[typing fixtures/typing-async.pyi]
342
334
343
- [case testNoYieldInAsyncDef]
344
- # flags: --python-version 3.5
345
-
346
- async def f():
347
- yield None # E: "yield" in async function
348
- async def g():
349
- yield # E: "yield" in async function
350
- async def h():
351
- x = yield # E: "yield" in async function
352
- [builtins fixtures/async_await.pyi]
353
-
354
335
[case testNoYieldFromInAsyncDef]
355
336
356
337
async def f():
@@ -422,7 +403,6 @@ def f() -> Generator[int, str, int]:
422
403
-- ---------------------------------------------------------------------
423
404
424
405
[case testAsyncGenerator]
425
- # flags: --python-version 3.6
426
406
from typing import AsyncGenerator, Generator
427
407
428
408
async def f() -> int:
@@ -450,7 +430,6 @@ async def wrong_return() -> Generator[int, None, None]: # E: The return type of
450
430
[typing fixtures/typing-async.pyi]
451
431
452
432
[case testAsyncGeneratorReturnIterator]
453
- # flags: --python-version 3.6
454
433
from typing import AsyncIterator
455
434
456
435
async def gen() -> AsyncIterator[int]:
@@ -466,7 +445,6 @@ async def use_gen() -> None:
466
445
[typing fixtures/typing-async.pyi]
467
446
468
447
[case testAsyncGeneratorManualIter]
469
- # flags: --python-version 3.6
470
448
from typing import AsyncGenerator
471
449
472
450
async def genfunc() -> AsyncGenerator[int, None]:
@@ -484,7 +462,6 @@ async def user() -> None:
484
462
[typing fixtures/typing-async.pyi]
485
463
486
464
[case testAsyncGeneratorAsend]
487
- # flags: --python-version 3.6
488
465
from typing import AsyncGenerator
489
466
490
467
async def f() -> None:
@@ -505,7 +482,6 @@ async def h() -> None:
505
482
[typing fixtures/typing-async.pyi]
506
483
507
484
[case testAsyncGeneratorAthrow]
508
- # flags: --python-version 3.6
509
485
from typing import AsyncGenerator
510
486
511
487
async def gen() -> AsyncGenerator[str, int]:
@@ -524,25 +500,20 @@ async def h() -> None:
524
500
[typing fixtures/typing-async.pyi]
525
501
526
502
[case testAsyncGeneratorNoSyncIteration]
527
- # flags: --python-version 3.6
528
503
from typing import AsyncGenerator
529
504
530
505
async def gen() -> AsyncGenerator[int, None]:
531
506
for i in [1, 2, 3]:
532
507
yield i
533
508
534
509
def h() -> None:
535
- for i in gen():
510
+ for i in gen(): # E: "AsyncGenerator[int, None]" has no attribute "__iter__"; maybe "__aiter__"? (not iterable)
536
511
pass
537
512
538
513
[builtins fixtures/dict.pyi]
539
514
[typing fixtures/typing-async.pyi]
540
515
541
- [out]
542
- main:9: error: "AsyncGenerator[int, None]" has no attribute "__iter__"; maybe "__aiter__"? (not iterable)
543
-
544
516
[case testAsyncGeneratorNoYieldFrom]
545
- # flags: --python-version 3.6
546
517
from typing import AsyncGenerator
547
518
548
519
async def f() -> AsyncGenerator[int, None]:
@@ -555,7 +526,6 @@ async def gen() -> AsyncGenerator[int, None]:
555
526
[typing fixtures/typing-async.pyi]
556
527
557
528
[case testAsyncGeneratorNoReturnWithValue]
558
- # flags: --python-version 3.6
559
529
from typing import AsyncGenerator
560
530
561
531
async def return_int() -> AsyncGenerator[int, None]:
0 commit comments