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 / not_in_loop.py @ 745
History | View | Annotate | Download (849 Bytes)
1 |
"""Test that not-in-loop is detected properly."""
|
---|---|
2 |
# pylint: disable=missing-docstring, invalid-name, too-few-public-methods
|
3 |
# pylint: disable=useless-else-on-loop, using-constant-test
|
4 |
|
5 |
while True: |
6 |
def ala(): |
7 |
continue # [not-in-loop] |
8 |
|
9 |
while True: |
10 |
pass
|
11 |
else:
|
12 |
continue # [not-in-loop] |
13 |
|
14 |
def lala(): |
15 |
continue # [not-in-loop] |
16 |
|
17 |
while True: |
18 |
class A(object): |
19 |
continue # [not-in-loop] |
20 |
|
21 |
for _ in range(10): |
22 |
pass
|
23 |
else:
|
24 |
continue # [not-in-loop] |
25 |
|
26 |
for _ in range(42): |
27 |
pass
|
28 |
else:
|
29 |
break # [not-in-loop] |
30 |
|
31 |
if True: |
32 |
continue # [not-in-loop] |
33 |
else:
|
34 |
break # [not-in-loop] |
35 |
|
36 |
for _ in range(10): |
37 |
for _ in range(20): |
38 |
pass
|
39 |
else:
|
40 |
continue
|
41 |
|
42 |
while True: |
43 |
while True: |
44 |
break
|
45 |
else:
|
46 |
break
|
47 |
break
|
48 |
else:
|
49 |
pass
|
50 |
|
51 |
for _ in range(1): |
52 |
continue
|
53 |
for _ in range(42): |
54 |
break
|