gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / pylint / test / functional / async_functions.py @ 745
History | View | Annotate | Download (1.25 KB)
1 |
"""Check that Python 3.5's async functions are properly analyzed by Pylint."""
|
---|---|
2 |
# pylint: disable=missing-docstring,invalid-name,too-few-public-methods
|
3 |
# pylint: disable=using-constant-test
|
4 |
|
5 |
async def next(): # [redefined-builtin] |
6 |
pass
|
7 |
|
8 |
async def some_function(arg1, arg2): # [unused-argument] |
9 |
await arg1 |
10 |
|
11 |
|
12 |
class OtherClass(object): |
13 |
|
14 |
@staticmethod
|
15 |
def test(): |
16 |
return 42 |
17 |
|
18 |
|
19 |
class Class(object): |
20 |
|
21 |
async def some_method(self): |
22 |
super(OtherClass, self).test() # [bad-super-call] |
23 |
|
24 |
|
25 |
# +1: [too-many-arguments,too-many-return-statements, too-many-branches]
|
26 |
async def complex_function(this, function, has, more, arguments, than, |
27 |
one, _, should, have): |
28 |
if 1: |
29 |
return this
|
30 |
elif 1: |
31 |
return function
|
32 |
elif 1: |
33 |
return has
|
34 |
elif 1: |
35 |
return more
|
36 |
elif 1: |
37 |
return arguments
|
38 |
elif 1: |
39 |
return than
|
40 |
try:
|
41 |
return one
|
42 |
finally:
|
43 |
pass
|
44 |
if 2: |
45 |
return should
|
46 |
while True: |
47 |
pass
|
48 |
if 1: |
49 |
return have
|
50 |
elif 2: |
51 |
return function
|
52 |
elif 3: |
53 |
pass
|
54 |
|
55 |
|
56 |
# +1: [duplicate-argument-name,dangerous-default-value]
|
57 |
async def func(a, a, b=[]): |
58 |
return a, b
|
59 |
|
60 |
|
61 |
# +1: [empty-docstring, blacklisted-name]
|
62 |
async def foo(): |
63 |
""
|
64 |
|
65 |
|