summaryrefslogtreecommitdiff
path: root/tests/functional/ext/check_elif/check_elif.py
blob: 23207ae8a7cd386a769c63ef34e780282d5face5 (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
# pylint: disable=no-else-raise,unsupported-membership-test,using-constant-test

"""Checks use of "else if" triggers a refactor message"""


def my_function():
    """docstring"""
    myint = 2
    if myint > 5:
        pass
    else:
        if myint <= 5:  # [else-if-used]
            pass
        else:
            myint = 3
            if myint > 2:
                if myint > 3:
                    pass
                elif myint == 3:
                    pass
                elif myint < 3:
                    pass
                else:
                    if myint:  # [else-if-used]
                        pass
            else:
                if myint:
                    pass
                myint = 4


def _if_in_fstring_comprehension():
    order = {}
    if "z" not in "false":
        raise TypeError(
            f" {', '.join(sorted(i for i in order or () if i not in vars))}"
        )
    elif "i" in "true":
        raise TypeError("d")