diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-11-20 15:41:14 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-11-20 15:41:14 +0200 |
commit | 37b1ec1d341e2a428cc87539ecf848d48bc2d3c0 (patch) | |
tree | a9b128819374eb50490ade03270f5f08a86bf300 | |
parent | f82665fccbd0a890998661b40639030a2c09e3a3 (diff) | |
download | pylint-37b1ec1d341e2a428cc87539ecf848d48bc2d3c0.tar.gz |
Disable some tests and capabilities since they need a more capable astroid than what's paired with this release
-rw-r--r-- | pylint/checkers/typecheck.py | 3 | ||||
-rw-r--r-- | pylint/test/functional/arguments.py | 24 | ||||
-rw-r--r-- | pylint/test/functional/arguments.txt | 4 | ||||
-rw-r--r-- | pylint/test/functional/class_members_py27.py | 18 | ||||
-rw-r--r-- | pylint/test/functional/class_members_py27.txt | 1 | ||||
-rw-r--r-- | pylint/test/functional/class_members_py30.py | 18 | ||||
-rw-r--r-- | pylint/test/functional/member_checks.py | 6 | ||||
-rw-r--r-- | pylint/test/functional/member_checks.txt | 3 |
8 files changed, 35 insertions, 42 deletions
diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index da9daf7..c188e49 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -779,8 +779,9 @@ accessed. Python regular expressions are accepted.'} self.add_message('not-context-manager', node=node, args=(infered.name, )) + # Disabled until we'll have a more capable astroid. @check_messages('invalid-unary-operand-type') - def visit_unaryop(self, node): + def _visit_unaryop(self, node): """Detect TypeErrors for unary operands.""" for error in node.type_errors(): diff --git a/pylint/test/functional/arguments.py b/pylint/test/functional/arguments.py index 8ae008d..9b428a6 100644 --- a/pylint/test/functional/arguments.py +++ b/pylint/test/functional/arguments.py @@ -110,18 +110,18 @@ class TestStaticMethod(object): self.test() # [no-value-for-parameter] self.test(42, 42, 42) # [too-many-function-args] - -class TypeCheckConstructor(object): - def __init__(self, first, second): - self.first = first - self.second = second - def test(self): - type(self)(1, 2, 3) # [too-many-function-args] - # +1: [no-value-for-parameter,no-value-for-parameter] - type(self)() - type(self)(1, lala=2) # [no-value-for-parameter,unexpected-keyword-arg] - type(self)(1, 2) - type(self)(first=1, second=2) +# Should be enabled on a more capable astroid (> 1.4.0) +# class TypeCheckConstructor(object): +# def __init__(self, first, second): +# self.first = first +# self.second = second +# def test(self): +# type(self)(1, 2, 3) +# # +# type(self)() +# type(self)(1, lala=2) +# type(self)(1, 2) +# type(self)(first=1, second=2) class Test(object): diff --git a/pylint/test/functional/arguments.txt b/pylint/test/functional/arguments.txt index 16b3216..c34f205 100644 --- a/pylint/test/functional/arguments.txt +++ b/pylint/test/functional/arguments.txt @@ -20,10 +20,6 @@ no-value-for-parameter:80:method_tests:No value for argument 'arg' in method cal no-value-for-parameter:81:method_tests:No value for argument 'arg' in unbound method call no-value-for-parameter:110:TestStaticMethod.func:No value for argument 'first' in staticmethod call too-many-function-args:111:TestStaticMethod.func:Too many positional arguments for staticmethod call -too-many-function-args:119:TypeCheckConstructor.test:Too many positional arguments for constructor call -no-value-for-parameter:121:TypeCheckConstructor.test:No value for argument 'first' in constructor call -no-value-for-parameter:121:TypeCheckConstructor.test:No value for argument 'second' in constructor call -no-value-for-parameter:122:TypeCheckConstructor.test:No value for argument 'second' in constructor call unexpected-keyword-arg:122:TypeCheckConstructor.test:Unexpected keyword argument 'lala' in constructor call no-value-for-parameter:133:Test.test:No value for argument 'icon' in function call too-many-function-args:134:Test.test:Too many positional arguments for function call diff --git a/pylint/test/functional/class_members_py27.py b/pylint/test/functional/class_members_py27.py index 415a890..899fe68 100644 --- a/pylint/test/functional/class_members_py27.py +++ b/pylint/test/functional/class_members_py27.py @@ -45,8 +45,8 @@ class UsingMetaclass(object): """ empty """
__metaclass__ = Metaclass
-TestMetaclass.register(int)
-UsingMetaclass.test()
+#TestMetaclass.register(int)
+#UsingMetaclass.test()
TestMetaclass().register(int) # [no-member]
UsingMetaclass().test() # [no-member]
@@ -56,10 +56,10 @@ class NoKnownBases(Missing): NoKnownBases().lalala()
-
-class MetaClass(object):
- """Look some methods in the implicit metaclass."""
-
- @classmethod
- def whatever(cls):
- return cls.mro() + cls.missing() # [no-member]
+# Should be enabled on astroid > 1.4.0
+#class MetaClass(object):
+# """Look some methods in the implicit metaclass."""
+#
+# @classmethod
+# def whatever(cls):
+# return cls.mro() + cls.missing()
diff --git a/pylint/test/functional/class_members_py27.txt b/pylint/test/functional/class_members_py27.txt index 3a3be0e..e5e6005 100644 --- a/pylint/test/functional/class_members_py27.txt +++ b/pylint/test/functional/class_members_py27.txt @@ -4,4 +4,3 @@ no-member:16:MyClass.test:Instance of 'MyClass' has no 'nonexistent1' member:INF no-member:17:MyClass.test:Instance of 'MyClass' has no 'nonexistent2' member:INFERENCE no-member:50::Instance of 'TestMetaclass' has no 'register' member:INFERENCE no-member:51::Instance of 'UsingMetaclass' has no 'test' member:INFERENCE -no-member:65:MetaClass.whatever:Class 'MetaClass' has no 'missing' member:INFERENCE diff --git a/pylint/test/functional/class_members_py30.py b/pylint/test/functional/class_members_py30.py index 8c27703..ccdf000 100644 --- a/pylint/test/functional/class_members_py30.py +++ b/pylint/test/functional/class_members_py30.py @@ -43,8 +43,8 @@ class Metaclass(type): class UsingMetaclass(object, metaclass=Metaclass):
""" empty """
-TestMetaclass.register(int)
-UsingMetaclass.test()
+# TestMetaclass.register(int)
+# UsingMetaclass.test()
TestMetaclass().register(int) # [no-member]
UsingMetaclass().test() # [no-member]
@@ -54,10 +54,10 @@ class NoKnownBases(Missing): NoKnownBases().lalala()
-
-class MetaClass(object):
- """Look some methods in the implicit metaclass."""
-
- @classmethod
- def whatever(cls):
- return cls.mro() + cls.missing() # [no-member]
+# Enabled on a more capable astroid (1.4.0)
+# class MetaClass(object):
+# """Look some methods in the implicit metaclass."""
+#
+# @classmethod
+# def whatever(cls):
+# return cls.mro() + cls.missing()
diff --git a/pylint/test/functional/member_checks.py b/pylint/test/functional/member_checks.py index 50a0d97..40c31b1 100644 --- a/pylint/test/functional/member_checks.py +++ b/pylint/test/functional/member_checks.py @@ -141,9 +141,9 @@ class SuperChecks(str, str): # pylint: disable=duplicate-bases def test(self): super(SuperChecks, self).lalala() -type(Client()).ala # [no-member] -type({}).bala # [no-member] -type('').portocala # [no-member] +type(Client()).ala +type({}).bala +type('').portocala def socket_false_positive(): diff --git a/pylint/test/functional/member_checks.txt b/pylint/test/functional/member_checks.txt index 6e527bc..1ad1ab0 100644 --- a/pylint/test/functional/member_checks.txt +++ b/pylint/test/functional/member_checks.txt @@ -12,7 +12,4 @@ no-member:97::Instance of 'Client' has no 'indeed' member:INFERENCE no-member:107::Instance of 'Client' has no 'indeed' member:INFERENCE no-member:114::Class 'Client' has no 'missing' member:INFERENCE no-member:120::Class 'Client' has no 'missing' member:INFERENCE -no-member:144::Class 'Client' has no 'ala' member:INFERENCE -no-member:145::Class 'dict' has no 'bala' member:INFERENCE -no-member:146::Class 'str' has no 'portocala' member:INFERENCE no-member:181:NoDunderNameInInstance.__init__:Instance of 'NoDunderNameInInstance' has no '__name__' member:INFERENCE
\ No newline at end of file |