blob: 3ea7573d2c0ed6ec3ded464f8827f69877d1036a (
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
|
"""Test that not-in-loop is detected properly."""
# pylint: disable=missing-docstring, invalid-name, too-few-public-methods
# pylint: disable=useless-else-on-loop, using-constant-test, useless-object-inheritance
while True:
def ala():
continue # [not-in-loop]
while True:
pass
else:
continue # [not-in-loop]
def lala():
continue # [not-in-loop]
while True:
class A(object):
continue # [not-in-loop]
for _ in range(10):
pass
else:
continue # [not-in-loop]
for _ in range(42):
pass
else:
break # [not-in-loop]
if True:
continue # [not-in-loop]
else:
break # [not-in-loop]
for _ in range(10):
for _ in range(20):
pass
else:
continue
while True:
while True:
break
else:
break
break
else:
pass
for _ in range(1):
continue
for _ in range(42):
break
|