summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten ter Huurne <maarten@treewalker.org>2009-11-25 15:15:40 +0100
committerMaarten ter Huurne <maarten@treewalker.org>2009-11-25 15:15:40 +0100
commitff61bb9e028724356c72e52db66dc3204fabe448 (patch)
tree50e46c4d05c64cdcbb9e01f6b39b7bfb3e843521
parentfdbd124e751f331a92177cf1811f1f5a493f3004 (diff)
downloadpylint-git-ff61bb9e028724356c72e52db66dc3204fabe448.tar.gz
Added test case that triggers false positive in the current code when a function is used as a method.
-rw-r--r--test/input/func_noerror_function_as_method.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/input/func_noerror_function_as_method.py b/test/input/func_noerror_function_as_method.py
new file mode 100644
index 000000000..fa42f2379
--- /dev/null
+++ b/test/input/func_noerror_function_as_method.py
@@ -0,0 +1,17 @@
+# pylint: disable-msg=R0903
+'''Test that a function is considered a method when looked up through a class.
+'''
+
+class Clazz(object):
+ 'test class'
+
+ def __init__(self, value):
+ self.value = value
+
+def func(arg1, arg2):
+ 'function that will be used as a method'
+ return arg1.value + arg2
+
+Clazz.method = func
+
+print Clazz(1).method(2)