aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/m/missing/missing_self_argument.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/m/missing/missing_self_argument.py')
-rw-r--r--tests/functional/m/missing/missing_self_argument.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/functional/m/missing/missing_self_argument.py b/tests/functional/m/missing/missing_self_argument.py
new file mode 100644
index 000000000..79ae34879
--- /dev/null
+++ b/tests/functional/m/missing/missing_self_argument.py
@@ -0,0 +1,21 @@
+"""Checks that missing self in method defs don't crash Pylint."""
+# pylint: disable=useless-object-inheritance
+
+
+
+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"