summaryrefslogtreecommitdiff
path: root/testsuite/W60.py
blob: f44552d95bc95a82d966dba990a9646bffacfa80 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#: W605:1:10
regex = '\.png$'
#: W605:2:1
regex = '''
\.png$
'''
#: W605:2:6
f(
    '\_'
)
#: W605:4:6
"""
multi-line
literal
with \_ somewhere
in the middle
"""
#: Okay
regex = r'\.png$'
regex = '\\.png$'
regex = r'''
\.png$
'''
regex = r'''
\\.png$
'''
s = '\\'
regex = '\w'  # noqa
regex = '''
\w
'''  # noqa
#: W606
async = 42
#: W606
await = 42
#: W606
await 42
#: W606
await 'test'
#: W606
def async():
    pass
#: W606
def await():
    pass
#: W606
class async:
    pass
#: W606
class await:
    pass
#: Okay
async def read_data(db):
    data = await db.fetch('SELECT ...')
#: Okay
if await fut:
    pass
if (await fut):
    pass
if await fut + 1:
    pass
if (await fut) + 1:
    pass
pair = await fut, 'spam'
pair = (await fut), 'spam'
with await fut, open():
    pass
with (await fut), open():
    pass
await foo()['spam'].baz()()
return await coro()
return (await coro())
res = await coro() ** 2
res = (await coro()) ** 2
func(a1=await coro(), a2=0)
func(a1=(await coro()), a2=0)
await foo() + await bar()
(await foo()) + (await bar())
-await foo()
-(await foo())
(await
 foo())
await(await foo())