summaryrefslogtreecommitdiff
path: root/testsuite/W60.py
blob: 5003677d47a19ecdf943d18fc143e29871e880a7 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#: W601
if a.has_key("b"):
    print a
#: W602
raise DummyError, "Message"
#: W602
raise ValueError, "hello %s %s" % (1, 2)
#: Okay
raise type_, val, tb
raise Exception, Exception("f"), t
#: W603
if x <> 0:
    x = 0
#: W604
val = `1 + 2`
#: 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())