summaryrefslogtreecommitdiff
path: root/pylint/test/functional/missing_self_argument.py
blob: 6477fcf4b89d41a40183181c607cabef078c681a (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(object):
    """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"