aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/n/not_in_loop.py
blob: f7319eef72e8d23633c8d8b5b9c928a276dda952 (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
"""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
# pylint: disable=no-else-continue

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