summaryrefslogtreecommitdiff
path: root/tests/functional/m/missing/missing_self_argument.py
blob: e3d3015dd9d6b48833f13b22926a52da58867cc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Checks that missing self in method defs don't crash Pylint."""



class MyClass:
    """A class with some methods missing self args."""

    def __init__(self):
        self.var = "var"

    def method():  # [no-method-argument]
        """A method without a self argument."""

    def setup():  # [no-method-argument]
        """A method without a self argument, but usage."""
        self.var = 1  # [undefined-variable]

    def correct(self):
        """Correct."""
        self.var = "correct"