summaryrefslogtreecommitdiff
path: root/pylint/test/functional/mapping_context.py
diff options
context:
space:
mode:
authorDmitry Pribysh <dmand@yandex.ru>2015-10-27 18:03:15 +0300
committerDmitry Pribysh <dmand@yandex.ru>2015-10-27 18:03:15 +0300
commit4f85cfbec5bd5576754274adb351116e164bc19a (patch)
treead255a14205ddfcdbfbc1a56c768bf467ab5153c /pylint/test/functional/mapping_context.py
parent328f24b72197c1a8ac22a58357f67740d6e1dd94 (diff)
downloadpylint-fix-685.tar.gz
Make iterable checker skip classes that are inferred to be abstractfix-685
Diffstat (limited to 'pylint/test/functional/mapping_context.py')
-rw-r--r--pylint/test/functional/mapping_context.py40
1 files changed, 39 insertions, 1 deletions
diff --git a/pylint/test/functional/mapping_context.py b/pylint/test/functional/mapping_context.py
index cfab8dc..72457b8 100644
--- a/pylint/test/functional/mapping_context.py
+++ b/pylint/test/functional/mapping_context.py
@@ -36,7 +36,7 @@ class NotMapping(object):
test(**NotMapping()) # [not-a-mapping]
-# skip checks if statement is inside mixin class
+# skip checks if statement is inside mixin/base/abstract class
class SomeMixin(object):
kwargs = None
@@ -50,6 +50,44 @@ class SomeMixin(object):
kws = self.get_kwargs()
self.run(**kws)
+class AbstractThing(object):
+ kwargs = None
+
+ def get_kwargs(self):
+ return self.kwargs
+
+ def run(self, **kwargs):
+ print(kwargs)
+
+ def dispatch(self):
+ kws = self.get_kwargs()
+ self.run(**kws)
+
+class BaseThing(object):
+ kwargs = None
+
+ def get_kwargs(self):
+ return self.kwargs
+
+ def run(self, **kwargs):
+ print(kwargs)
+
+ def dispatch(self):
+ kws = self.get_kwargs()
+ self.run(**kws)
+
+# abstract class
+class Thing(object):
+ def get_kwargs(self):
+ raise NotImplementedError
+
+ def run(self, **kwargs):
+ print(kwargs)
+
+ def dispatch(self):
+ kwargs = self.get_kwargs()
+ self.run(**kwargs)
+
# skip uninferable instances
from some_missing_module import Mapping