blob: 1012fbee302cf26b482f289ff9c6361324c5b82f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
"""
Checks that we don't erroneously emit not-an-iterable errors for
coroutines built with asyncio.coroutine.
These decorators were deprecated in 3.8 and removed in 3.11.
"""
# pylint: disable=missing-docstring,too-few-public-methods,unused-argument,bad-mcs-method-argument
# pylint: disable=wrong-import-position
import asyncio
@asyncio.coroutine
def coroutine_function_return_none():
return
@asyncio.coroutine
def coroutine_function_return_object():
return 12
@asyncio.coroutine
def coroutine_function_return_future():
return asyncio.Future()
@asyncio.coroutine
def coroutine_function_pass():
pass
@asyncio.coroutine
def coroutine_generator():
yield
@asyncio.coroutine
def main():
yield from coroutine_function_return_none()
yield from coroutine_function_return_object()
yield from coroutine_function_return_future()
yield from coroutine_function_pass()
yield from coroutine_generator()
|