summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Marek <shlomme@gmail.com>2014-07-26 19:09:55 +0200
committerTorsten Marek <shlomme@gmail.com>2014-07-26 19:09:55 +0200
commitf0156c24770d69662b77810b5ea3250f26fbce03 (patch)
treee8d2b6c6cf716de5551df1cd288f09d40cb06468
parent727e1c2034da936f8560827e75b33a34983fbd39 (diff)
downloadpylint-f0156c24770d69662b77810b5ea3250f26fbce03.tar.gz
Converted more test cases to the new test framework.
-rw-r--r--test/functional/access_to__name__.py (renamed from test/input/func___name___access.py)10
-rw-r--r--test/functional/access_to__name__.txt3
-rw-r--r--test/functional/access_to_protected_members.py (renamed from test/input/func_class_access_protected_members.py)19
-rw-r--r--test/functional/access_to_protected_members.txt5
-rw-r--r--test/functional/arguments.py (renamed from test/input/func_arguments.py)38
-rw-r--r--test/functional/arguments.txt20
-rw-r--r--test/functional/duplicate_dict_literal_key.py (renamed from test/input/func_dict_keys.py)3
-rw-r--r--test/functional/duplicate_dict_literal_key.txt1
-rw-r--r--test/functional/globals.py24
-rw-r--r--test/functional/globals.txt6
-rw-r--r--test/functional/invalid__all__object.py3
-rw-r--r--test/functional/invalid__all__object.txt1
-rw-r--r--test/functional/invalid_exceptions_raised.py51
-rw-r--r--test/functional/invalid_exceptions_raised.txt11
-rw-r--r--test/functional/names_in__all__.py (renamed from test/input/func_all.py)12
-rw-r--r--test/functional/names_in__all__.txt4
-rw-r--r--test/functional/newstyle_properties.py (renamed from test/input/func_newstyle_property.py)25
-rw-r--r--test/functional/newstyle_properties.txt2
-rw-r--r--test/functional/super_checks.py (renamed from test/input/func_newstyle_super.py)19
-rw-r--r--test/functional/super_checks.txt8
-rw-r--r--test/functional/uninferable_all_object.py (renamed from test/input/func_noerror_all_no_inference.py)7
-rw-r--r--test/input/func_all_undefined.py8
-rw-r--r--test/input/func_exceptions_raise_type_error.py14
-rw-r--r--test/input/func_globals.py40
-rw-r--r--test/input/func_missing_super_argument_py_30.py9
-rw-r--r--test/input/func_newstyle_exceptions.py37
-rw-r--r--test/messages/func___name___access.txt4
-rw-r--r--test/messages/func___name___access_py30.txt3
-rw-r--r--test/messages/func_all.txt4
-rw-r--r--test/messages/func_all_undefined.txt1
-rw-r--r--test/messages/func_arguments.txt20
-rw-r--r--test/messages/func_class_access_protected_members.txt5
-rw-r--r--test/messages/func_dict_keys.txt1
-rw-r--r--test/messages/func_exceptions_raise_type_error.txt2
-rw-r--r--test/messages/func_globals.txt6
-rw-r--r--test/messages/func_missing_super_argument_py_30.txt2
-rw-r--r--test/messages/func_newstyle_exceptions.txt7
-rw-r--r--test/messages/func_newstyle_exceptions_py30.txt5
-rw-r--r--test/messages/func_newstyle_property.txt2
-rw-r--r--test/messages/func_newstyle_property_py30.txt0
-rw-r--r--test/messages/func_newstyle_super.txt8
-rw-r--r--test/messages/func_newstyle_super_py30.txt4
-rw-r--r--test/test_func.py4
43 files changed, 208 insertions, 250 deletions
diff --git a/test/input/func___name___access.py b/test/functional/access_to__name__.py
index def8674..21da530 100644
--- a/test/input/func___name___access.py
+++ b/test/functional/access_to__name__.py
@@ -1,15 +1,15 @@
-# pylint: disable=R0903,W0142
+# pylint: disable=too-few-public-methods,star-args
"""test access to __name__ gives undefined member on new/old class instances
but not on new/old class object
"""
-__revision__ = 1
-class Aaaa:
+class Aaaa: # <3.0:[old-style-class]
"""old class"""
def __init__(self):
- print self.__name__
+ print self.__name__ # [no-member]
print self.__class__.__name__
+
class NewClass(object):
"""new class"""
@@ -18,4 +18,4 @@ class NewClass(object):
return object.__new__(cls, *args, **kwargs)
def __init__(self):
- print 'init', self.__name__
+ print 'init', self.__name__ # [no-member]
diff --git a/test/functional/access_to__name__.txt b/test/functional/access_to__name__.txt
new file mode 100644
index 0000000..2c0a953
--- /dev/null
+++ b/test/functional/access_to__name__.txt
@@ -0,0 +1,3 @@
+old-style-class:7:Aaaa:Old-style class defined.
+no-member:10:Aaaa.__init__:Instance of 'Aaaa' has no '__name__' member
+no-member:21:NewClass.__init__:Instance of 'NewClass' has no '__name__' member
diff --git a/test/input/func_class_access_protected_members.py b/test/functional/access_to_protected_members.py
index f2ad5b7..8f1c928 100644
--- a/test/input/func_class_access_protected_members.py
+++ b/test/functional/access_to_protected_members.py
@@ -1,9 +1,9 @@
-# pylint: disable=R0903, C0111, W0231
-"""test external access to protected class members"""
+# pylint: disable=too-few-public-methods, W0231
+"""Test external access to protected class members."""
-__revision__ = ''
class MyClass(object):
+ """Class with protected members."""
_cls_protected = 5
def __init__(self, other):
@@ -13,15 +13,18 @@ class MyClass(object):
self.attr = 0
def test(self):
+ """Docstring."""
self._protected += self._cls_protected
- print self.public._haha
+ print self.public._haha # [protected-access]
def clsmeth(cls):
+ """Docstring."""
cls._cls_protected += 1
print cls._cls_protected
clsmeth = classmethod(clsmeth)
class Subclass(MyClass):
+ """Subclass with protected members."""
def __init__(self):
MyClass._protected = 5
@@ -29,8 +32,8 @@ class Subclass(MyClass):
INST = Subclass()
INST.attr = 1
print INST.attr
-INST._protected = 2
-print INST._protected
-INST._cls_protected = 3
-print INST._cls_protected
+INST._protected = 2 # [protected-access]
+print INST._protected # [protected-access]
+INST._cls_protected = 3 # [protected-access]
+print INST._cls_protected # [protected-access]
diff --git a/test/functional/access_to_protected_members.txt b/test/functional/access_to_protected_members.txt
new file mode 100644
index 0000000..b933c23
--- /dev/null
+++ b/test/functional/access_to_protected_members.txt
@@ -0,0 +1,5 @@
+protected-access:18:MyClass.test:Access to a protected member _haha of a client class
+protected-access:35::Access to a protected member _protected of a client class
+protected-access:36::Access to a protected member _protected of a client class
+protected-access:37::Access to a protected member _cls_protected of a client class
+protected-access:38::Access to a protected member _cls_protected of a client class
diff --git a/test/input/func_arguments.py b/test/functional/arguments.py
index b607699..46dae22 100644
--- a/test/input/func_arguments.py
+++ b/test/functional/arguments.py
@@ -1,5 +1,5 @@
+# pylint: disable=too-few-public-methods
"""Test function argument checker"""
-__revision__ = ''
def decorator(fun):
"""Decorator"""
@@ -43,48 +43,46 @@ def function_default_arg(one=1, two=2):
function_1_arg(420)
-function_1_arg()
-function_1_arg(1337, 347)
+function_1_arg() # [no-value-for-parameter]
+function_1_arg(1337, 347) # [too-many-function-args]
-function_3_args(420, 789)
+function_3_args(420, 789) # [no-value-for-parameter]
+# +1:[no-value-for-parameter,no-value-for-parameter,no-value-for-parameter]
function_3_args()
function_3_args(1337, 347, 456)
-function_3_args('bab', 'bebe', None, 5.6)
+function_3_args('bab', 'bebe', None, 5.6) # [too-many-function-args]
function_default_arg(1, two=5)
function_default_arg(two=5)
-# repeated keyword is syntax error in python >= 2.6:
-# tests are moved to func_keyword_repeat_py25- / func_keyword_repeat_py26
-function_1_arg(bob=4)
-function_default_arg(1, 4, coin="hello")
+function_1_arg(bob=4) # [unexpected-keyword-arg,no-value-for-parameter]
+function_default_arg(1, 4, coin="hello") # [unexpected-keyword-arg]
-function_default_arg(1, one=5)
+function_default_arg(1, one=5) # [redundant-keyword-arg]
# Remaining tests are for coverage of correct names in messages.
LAMBDA = lambda arg: 1
-LAMBDA()
+LAMBDA() # [no-value-for-parameter]
def method_tests():
""""Method invocations."""
demo = DemoClass()
- demo.static_method()
- DemoClass.static_method()
+ demo.static_method() # [no-value-for-parameter]
+ DemoClass.static_method() # [no-value-for-parameter]
- demo.class_method()
- DemoClass.class_method()
+ demo.class_method() # [no-value-for-parameter]
+ DemoClass.class_method() # [no-value-for-parameter]
- demo.method()
- DemoClass.method(demo)
+ demo.method() # [no-value-for-parameter]
+ DemoClass.method(demo) # [no-value-for-parameter]
- demo.decorated_method()
- DemoClass.decorated_method(demo)
+ demo.decorated_method() # [no-value-for-parameter]
+ DemoClass.decorated_method(demo) # [no-value-for-parameter]
# Test a regression (issue #234)
import sys
-# pylint: disable=too-few-public-methods
class Text(object):
""" Regression """
diff --git a/test/functional/arguments.txt b/test/functional/arguments.txt
new file mode 100644
index 0000000..050f2c4
--- /dev/null
+++ b/test/functional/arguments.txt
@@ -0,0 +1,20 @@
+no-value-for-parameter:46::No value for argument 'first_argument' in function call
+too-many-function-args:47::Too many positional arguments for function call
+no-value-for-parameter:49::No value for argument 'third_argument' in function call
+no-value-for-parameter:51::No value for argument 'first_argument' in function call
+no-value-for-parameter:51::No value for argument 'second_argument' in function call
+no-value-for-parameter:51::No value for argument 'third_argument' in function call
+too-many-function-args:53::Too many positional arguments for function call
+no-value-for-parameter:58::No value for argument 'first_argument' in function call
+unexpected-keyword-arg:58::Unexpected keyword argument 'bob' in function call
+unexpected-keyword-arg:59::Unexpected keyword argument 'coin' in function call
+redundant-keyword-arg:61::Argument 'one' passed by position and keyword in function call
+no-value-for-parameter:66::No value for argument 'arg' in lambda call
+no-value-for-parameter:71:method_tests:No value for argument 'arg' in staticmethod call
+no-value-for-parameter:72:method_tests:No value for argument 'arg' in staticmethod call
+no-value-for-parameter:74:method_tests:No value for argument 'arg' in classmethod call
+no-value-for-parameter:75:method_tests:No value for argument 'arg' in classmethod call
+no-value-for-parameter:77:method_tests:No value for argument 'arg' in method call
+no-value-for-parameter:78:method_tests:No value for argument 'arg' in unbound method call
+no-value-for-parameter:80:method_tests:No value for argument 'arg' in method call
+no-value-for-parameter:81:method_tests:No value for argument 'arg' in unbound method call
diff --git a/test/input/func_dict_keys.py b/test/functional/duplicate_dict_literal_key.py
index 24c8b1f..f74e10e 100644
--- a/test/input/func_dict_keys.py
+++ b/test/functional/duplicate_dict_literal_key.py
@@ -1,13 +1,12 @@
"""Check multiple key definition"""
#pylint: disable=C0103
-__revision__ = 5
correct_dict = {
'tea': 'for two',
'two': 'for tea',
}
-wrong_dict = {
+wrong_dict = { # [duplicate-key]
'tea': 'for two',
'two': 'for tea',
'tea': 'time',
diff --git a/test/functional/duplicate_dict_literal_key.txt b/test/functional/duplicate_dict_literal_key.txt
new file mode 100644
index 0000000..9780480
--- /dev/null
+++ b/test/functional/duplicate_dict_literal_key.txt
@@ -0,0 +1 @@
+duplicate-key:9::Duplicate key 'tea' in dictionary
diff --git a/test/functional/globals.py b/test/functional/globals.py
new file mode 100644
index 0000000..04bfd95
--- /dev/null
+++ b/test/functional/globals.py
@@ -0,0 +1,24 @@
+"""Warnings about global statements and usage of global variables."""
+
+global CSTE # [global-at-module-level]
+print CSTE # [undefined-variable]
+
+CONSTANT = 1
+
+def fix_contant(value):
+ """all this is ok, but try not using global ;)"""
+ global CONSTANT # [global-statement]
+ print CONSTANT
+ CONSTANT = value
+
+
+def other():
+ """global behaviour test"""
+ global HOP # [global-variable-not-assigned]
+ print HOP # [undefined-variable]
+
+
+def define_constant():
+ """ok but somevar is not defined at the module scope"""
+ global SOMEVAR # [global-variable-undefined]
+ SOMEVAR = 2
diff --git a/test/functional/globals.txt b/test/functional/globals.txt
new file mode 100644
index 0000000..0f9d13a
--- /dev/null
+++ b/test/functional/globals.txt
@@ -0,0 +1,6 @@
+global-at-module-level:3::Using the global statement at the module level
+undefined-variable:4::Undefined variable 'CSTE'
+global-statement:10:fix_contant:Using the global statement
+global-variable-not-assigned:17:other:Using global for 'HOP' but no assignment is done
+undefined-variable:18:other:Undefined variable 'HOP'
+global-variable-undefined:23:define_constant:Global variable 'SOMEVAR' undefined at the module level
diff --git a/test/functional/invalid__all__object.py b/test/functional/invalid__all__object.py
new file mode 100644
index 0000000..2a1a592
--- /dev/null
+++ b/test/functional/invalid__all__object.py
@@ -0,0 +1,3 @@
+"""Test that non-inferable __all__ variables do not make Pylint crash."""
+
+__all__ = [SomeUndefinedName] # [undefined-variable]
diff --git a/test/functional/invalid__all__object.txt b/test/functional/invalid__all__object.txt
new file mode 100644
index 0000000..03ad496
--- /dev/null
+++ b/test/functional/invalid__all__object.txt
@@ -0,0 +1 @@
+undefined-variable:3::Undefined variable 'SomeUndefinedName'
diff --git a/test/functional/invalid_exceptions_raised.py b/test/functional/invalid_exceptions_raised.py
new file mode 100644
index 0000000..fe6223d
--- /dev/null
+++ b/test/functional/invalid_exceptions_raised.py
@@ -0,0 +1,51 @@
+# pylint:disable=too-few-public-methods,old-style-class,no-init
+"""test pb with exceptions and old/new style classes"""
+
+
+class ValidException(Exception):
+ """Valid Exception."""
+
+class OldStyleClass:
+ """Not an exception."""
+
+class NewStyleClass(object):
+ """Not an exception."""
+
+
+def good_case():
+ """raise"""
+ raise ValidException('hop')
+
+def bad_case0():
+ """raise"""
+ # +2:<3.0:[nonstandard-exception]
+ # +1:>=3.0:[raising-non-exception]
+ raise OldStyleClass('hop')
+
+def bad_case1():
+ """raise"""
+ raise NewStyleClass() # [raising-non-exception]
+
+def bad_case2():
+ """raise"""
+ # +2:<3.0:[old-raise-syntax,nonstandard-exception]
+ # +1:>=3.0:[raising-non-exception]
+ raise OldStyleClass, 'hop'
+
+def bad_case3():
+ """raise"""
+ raise NewStyleClass # [raising-non-exception]
+
+def bad_case4():
+ """raise"""
+ # +1:<3.0:[old-raise-syntax]
+ raise NotImplemented, 'hop' # [notimplemented-raised]
+
+def bad_case5():
+ """raise"""
+ raise 1 # [raising-bad-type]
+
+def base_case6():
+ """raise"""
+ raise None # [raising-bad-type]
+
diff --git a/test/functional/invalid_exceptions_raised.txt b/test/functional/invalid_exceptions_raised.txt
new file mode 100644
index 0000000..756d92c
--- /dev/null
+++ b/test/functional/invalid_exceptions_raised.txt
@@ -0,0 +1,11 @@
+raising-non-exception:23:bad_case0:Raising a new style class which doesn't inherit from BaseException
+nonstandard-exception:23:bad_case0:Exception doesn't inherit from standard "Exception" class
+raising-non-exception:27:bad_case1:Raising a new style class which doesn't inherit from BaseException
+raising-non-exception:33:bad_case2:Raising a new style class which doesn't inherit from BaseException
+nonstandard-exception:33:bad_case2:Exception doesn't inherit from standard "Exception" class
+old-raise-syntax:33:bad_case2:Use raise ErrorClass(args) instead of raise ErrorClass, args.
+raising-non-exception:37:bad_case3:Raising a new style class which doesn't inherit from BaseException
+notimplemented-raised:42:bad_case4:NotImplemented raised - should raise NotImplementedError
+old-raise-syntax:42:bad_case4:Use raise ErrorClass(args) instead of raise ErrorClass, args.
+raising-bad-type:46:bad_case5:Raising int while only classes, instances or string are allowed
+raising-bad-type:50:base_case6:Raising NoneType while only classes, instances or string are allowed
diff --git a/test/input/func_all.py b/test/functional/names_in__all__.py
index 0fd75dc..acd94c3 100644
--- a/test/input/func_all.py
+++ b/test/functional/names_in__all__.py
@@ -1,3 +1,4 @@
+# pylint: disable=too-few-public-methods,no-self-use
"""Test Pylint's use of __all__.
* NonExistant is not defined in this module, and it is listed in
@@ -6,20 +7,18 @@
* This module imports path and republished it in __all__. No errors
are expected.
"""
-# pylint: disable=R0903,R0201,W0612
-__revision__ = 0
from os import path
from collections import deque
__all__ = [
'Dummy',
- 'NonExistant',
+ 'NonExistant', # [undefined-all-variable]
'path',
- 'func',
- 'inner',
- 'InnerKlass', deque.__name__]
+ 'func', # [undefined-all-variable]
+ 'inner', # [undefined-all-variable]
+ 'InnerKlass', deque.__name__] # [undefined-all-variable]
class Dummy(object):
@@ -40,6 +39,7 @@ class Klass(object):
def func(self):
"""A klass method"""
inner = None
+ print inner
class InnerKlass(object):
"""A inner klass"""
diff --git a/test/functional/names_in__all__.txt b/test/functional/names_in__all__.txt
new file mode 100644
index 0000000..6cd7ae5
--- /dev/null
+++ b/test/functional/names_in__all__.txt
@@ -0,0 +1,4 @@
+undefined-all-variable:17::Undefined variable name 'NonExistant' in __all__
+undefined-all-variable:19::Undefined variable name 'func' in __all__
+undefined-all-variable:20::Undefined variable name 'inner' in __all__
+undefined-all-variable:21::Undefined variable name 'InnerKlass' in __all__
diff --git a/test/input/func_newstyle_property.py b/test/functional/newstyle_properties.py
index 84a07fc..110fa3b 100644
--- a/test/input/func_newstyle_property.py
+++ b/test/functional/newstyle_properties.py
@@ -1,24 +1,30 @@
-# pylint: disable=R0903
-"""test property on old style class and property.setter/deleter usage"""
+# pylint: disable=too-few-public-methods
+"""Test properties on old style classes and property.setter/deleter usage"""
-__revision__ = 1
def getter(self):
"""interesting"""
return self
-class OkOk(object):
+class CorrectClass(object):
"""correct usage"""
method = property(getter, doc='hop')
-class HaNonNonNon:
+class OldStyleClass: # <3.0:[old-style-class]
"""bad usage"""
- method = property(getter, doc='hop')
+ method = property(getter, doc='hop') # <3.0:[property-on-old-class]
def __init__(self):
pass
-import logilab.common.decorators
+
+def decorator(func):
+ """Redefining decorator."""
+ def wrapped(self):
+ """Wrapper function."""
+ return func(self)
+ return wrapped
+
class SomeClass(object):
"""another docstring"""
@@ -41,8 +47,7 @@ class SomeClass(object):
"""I'm the 'prop' property."""
del self._prop
- # test regression
- @logilab.common.decorators.cached
+ @decorator
def noregr(self):
- """used to crash in redefined_by_decorator"""
+ """Just a normal method with a decorator."""
return self.prop
diff --git a/test/functional/newstyle_properties.txt b/test/functional/newstyle_properties.txt
new file mode 100644
index 0000000..f3a8dbb
--- /dev/null
+++ b/test/functional/newstyle_properties.txt
@@ -0,0 +1,2 @@
+old-style-class:13:OldStyleClass:Old-style class defined.
+property-on-old-class:15:OldStyleClass:Use of "property" on an old style class
diff --git a/test/input/func_newstyle_super.py b/test/functional/super_checks.py
index 10e9b28..d9acfa3 100644
--- a/test/input/func_newstyle_super.py
+++ b/test/functional/super_checks.py
@@ -1,16 +1,15 @@
-# pylint: disable=R0903,import-error
+# pylint: disable=too-few-public-methods,import-error
"""check use of super"""
from unknown import Missing
-__revision__ = None
-class Aaaa:
+class Aaaa: # <3.0:[old-style-class]
"""old style"""
- def hop(self):
+ def hop(self): # <3.0:[super-on-old-class]
"""hop"""
super(Aaaa, self).hop()
- def __init__(self):
+ def __init__(self): # <3.0:[super-on-old-class]
super(Aaaa, self).__init__()
class NewAaaa(object):
@@ -20,22 +19,22 @@ class NewAaaa(object):
super(NewAaaa, self).hop()
def __init__(self):
- super(object, self).__init__()
+ super(object, self).__init__() # [bad-super-call]
class Py3kAaaa(NewAaaa):
"""new style"""
def __init__(self):
- super().__init__()
+ super().__init__() # <3.0:[missing-super-argument]
class Py3kWrongSuper(Py3kAaaa):
"""new style"""
def __init__(self):
- super(NewAaaa, self).__init__()
+ super(NewAaaa, self).__init__() # [bad-super-call]
class WrongNameRegression(Py3kAaaa):
""" test a regression with the message """
def __init__(self):
- super(Missing, self).__init__()
+ super(Missing, self).__init__() # [bad-super-call]
class Getattr(object):
""" crash """
@@ -44,4 +43,4 @@ class Getattr(object):
class CrashSuper(object):
""" test a crash with this checker """
def __init__(self):
- super(Getattr.name, self).__init__()
+ super(Getattr.name, self).__init__() # [bad-super-call]
diff --git a/test/functional/super_checks.txt b/test/functional/super_checks.txt
new file mode 100644
index 0000000..2d69098
--- /dev/null
+++ b/test/functional/super_checks.txt
@@ -0,0 +1,8 @@
+old-style-class:6:Aaaa:Old-style class defined.
+super-on-old-class:8:Aaaa.hop:Use of super on an old style class
+super-on-old-class:12:Aaaa.__init__:Use of super on an old style class
+bad-super-call:22:NewAaaa.__init__:Bad first argument 'object' given to super()
+missing-super-argument:27:Py3kAaaa.__init__:Missing argument to super()
+bad-super-call:32:Py3kWrongSuper.__init__:Bad first argument 'NewAaaa' given to super()
+bad-super-call:37:WrongNameRegression.__init__:Bad first argument 'Missing' given to super()
+bad-super-call:46:CrashSuper.__init__:Bad first argument 'NewAaaa' given to super()
diff --git a/test/input/func_noerror_all_no_inference.py b/test/functional/uninferable_all_object.py
index d3af45c..3e565f9 100644
--- a/test/input/func_noerror_all_no_inference.py
+++ b/test/functional/uninferable_all_object.py
@@ -1,9 +1,4 @@
-"""Test that non-inferable __all__ variables do not make Pylint crash.
-
-"""
-# pylint: disable=R0903,R0201,W0612
-
-__revision__ = 0
+"""Test that non-inferable __all__ variables do not make Pylint crash."""
__all__ = sorted([
'Dummy',
diff --git a/test/input/func_all_undefined.py b/test/input/func_all_undefined.py
deleted file mode 100644
index 4d2301d..0000000
--- a/test/input/func_all_undefined.py
+++ /dev/null
@@ -1,8 +0,0 @@
-"""Test that non-inferable __all__ variables do not make Pylint crash.
-
-"""
-# pylint: disable=R0903,R0201,W0612
-
-__revision__ = 0
-
-__all__ = [SomeUndefinedName]
diff --git a/test/input/func_exceptions_raise_type_error.py b/test/input/func_exceptions_raise_type_error.py
deleted file mode 100644
index 8c414b6..0000000
--- a/test/input/func_exceptions_raise_type_error.py
+++ /dev/null
@@ -1,14 +0,0 @@
-"""
-'E0702': Raising an %s while only classes, instances or string are allowed
-
-Used when something which is neither a class, an instance or a string is
-raised (i.e. a `TypeError` will be raised).
-"""
-
-__revision__ = 1
-
-if __revision__:
- raise 1
-
-if __revision__:
- raise None
diff --git a/test/input/func_globals.py b/test/input/func_globals.py
deleted file mode 100644
index cf58128..0000000
--- a/test/input/func_globals.py
+++ /dev/null
@@ -1,40 +0,0 @@
-"""
-'W0601': ('global variable %s undefined at the module level',
- 'Used when a variable is defined through the "global" statement \
- but the variable is not defined in the module scope.'),
-'W0602': ('Using global for %s but no assignment is done',
- 'Used when a variable is defined through the "global" statement \
- but no assignment to this variable is done.'),
-'W0603': ('Using the global statement', # W0121
- 'Used when you use the "global" statement to update a global \
- variable. Pylint just try to discourage this \
- usage. That doesn\'t mean you can not use it !'),
-'W0604': ('Using the global statement at the module level', # W0103
- 'Used when you use the "global" statement at the module level \
- since it has no effect'),
-"""
-
-__revision__ = ''
-
-CONSTANT = 1
-
-def fix_contant(value):
- """all this is ok, but try not using global ;)"""
- global CONSTANT
- print CONSTANT
- CONSTANT = value
-global CSTE # useless
-print CSTE # ko
-
-def other():
- """global behaviour test"""
- global HOP
- print HOP # ko
-
-other()
-
-
-def define_constant():
- """ok but somevar is not defined at the module scope"""
- global SOMEVAR
- SOMEVAR = 2
diff --git a/test/input/func_missing_super_argument_py_30.py b/test/input/func_missing_super_argument_py_30.py
deleted file mode 100644
index ec20857..0000000
--- a/test/input/func_missing_super_argument_py_30.py
+++ /dev/null
@@ -1,9 +0,0 @@
-"""Check missing super argument for Python 2"""
-
-__revision__ = 0
-
-class MyClass(object):
- """ New style class """
- def __init__(self):
- super().__init__()
- \ No newline at end of file
diff --git a/test/input/func_newstyle_exceptions.py b/test/input/func_newstyle_exceptions.py
deleted file mode 100644
index ee6e60e..0000000
--- a/test/input/func_newstyle_exceptions.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# pylint: disable=C0103
-"""test pb with exceptions and old/new style classes"""
-
-__revision__ = 1
-
-class OkException(Exception):
- """bien bien bien"""
-
-class BofException:
- """mouais"""
-
-class NewException(object):
- """non si py < 2.5 !"""
-
-def fonctionOk():
- """raise"""
- raise OkException('hop')
-
-def fonctionBof():
- """raise"""
- raise BofException('hop')
-
-def fonctionNew():
- """raise"""
- raise NewException()
-
-def fonctionBof2():
- """raise"""
- raise BofException, 'hop'
-
-def fonctionNew2():
- """raise"""
- raise NewException
-
-def fonctionNotImplemented():
- """raise"""
- raise NotImplemented, 'hop'
diff --git a/test/messages/func___name___access.txt b/test/messages/func___name___access.txt
deleted file mode 100644
index 4351425..0000000
--- a/test/messages/func___name___access.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-C: 8:Aaaa: Old-style class defined.
-E: 11:Aaaa.__init__: Instance of 'Aaaa' has no '__name__' member
-E: 21:NewClass.__init__: Instance of 'NewClass' has no '__name__' member
-
diff --git a/test/messages/func___name___access_py30.txt b/test/messages/func___name___access_py30.txt
deleted file mode 100644
index 51aeeaa..0000000
--- a/test/messages/func___name___access_py30.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-E: 11:Aaaa.__init__: Instance of 'Aaaa' has no '__name__' member
-E: 21:NewClass.__init__: Instance of 'NewClass' has no '__name__' member
-
diff --git a/test/messages/func_all.txt b/test/messages/func_all.txt
deleted file mode 100644
index fb314a7..0000000
--- a/test/messages/func_all.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-E: 18: Undefined variable name 'NonExistant' in __all__
-E: 20: Undefined variable name 'func' in __all__
-E: 21: Undefined variable name 'inner' in __all__
-E: 22: Undefined variable name 'InnerKlass' in __all__
diff --git a/test/messages/func_all_undefined.txt b/test/messages/func_all_undefined.txt
deleted file mode 100644
index f4170f2..0000000
--- a/test/messages/func_all_undefined.txt
+++ /dev/null
@@ -1 +0,0 @@
-E: 8: Undefined variable 'SomeUndefinedName'
diff --git a/test/messages/func_arguments.txt b/test/messages/func_arguments.txt
deleted file mode 100644
index e930b20..0000000
--- a/test/messages/func_arguments.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-E: 46: No value for argument 'first_argument' in function call
-E: 47: Too many positional arguments for function call
-E: 49: No value for argument 'third_argument' in function call
-E: 50: No value for argument 'first_argument' in function call
-E: 50: No value for argument 'second_argument' in function call
-E: 50: No value for argument 'third_argument' in function call
-E: 52: Too many positional arguments for function call
-E: 59: No value for argument 'first_argument' in function call
-E: 59: Unexpected keyword argument 'bob' in function call
-E: 60: Unexpected keyword argument 'coin' in function call
-E: 62: Argument 'one' passed by position and keyword in function call
-E: 67: No value for argument 'arg' in lambda call
-E: 72:method_tests: No value for argument 'arg' in staticmethod call
-E: 73:method_tests: No value for argument 'arg' in staticmethod call
-E: 75:method_tests: No value for argument 'arg' in classmethod call
-E: 76:method_tests: No value for argument 'arg' in classmethod call
-E: 78:method_tests: No value for argument 'arg' in method call
-E: 79:method_tests: No value for argument 'arg' in unbound method call
-E: 81:method_tests: No value for argument 'arg' in method call
-E: 82:method_tests: No value for argument 'arg' in unbound method call
diff --git a/test/messages/func_class_access_protected_members.txt b/test/messages/func_class_access_protected_members.txt
deleted file mode 100644
index 5900960..0000000
--- a/test/messages/func_class_access_protected_members.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-W: 17:MyClass.test: Access to a protected member _haha of a client class
-W: 32: Access to a protected member _protected of a client class
-W: 33: Access to a protected member _protected of a client class
-W: 34: Access to a protected member _cls_protected of a client class
-W: 35: Access to a protected member _cls_protected of a client class \ No newline at end of file
diff --git a/test/messages/func_dict_keys.txt b/test/messages/func_dict_keys.txt
deleted file mode 100644
index 8773298..0000000
--- a/test/messages/func_dict_keys.txt
+++ /dev/null
@@ -1 +0,0 @@
-W: 10: Duplicate key 'tea' in dictionary
diff --git a/test/messages/func_exceptions_raise_type_error.txt b/test/messages/func_exceptions_raise_type_error.txt
deleted file mode 100644
index 349b9f5..0000000
--- a/test/messages/func_exceptions_raise_type_error.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-E: 11: Raising int while only classes, instances or string are allowed
-E: 14: Raising NoneType while only classes, instances or string are allowed
diff --git a/test/messages/func_globals.txt b/test/messages/func_globals.txt
deleted file mode 100644
index d1bb53d..0000000
--- a/test/messages/func_globals.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-E: 27: Undefined variable 'CSTE'
-E: 32:other: Undefined variable 'HOP'
-W: 23:fix_contant: Using the global statement
-W: 26: Using the global statement at the module level
-W: 31:other: Using global for 'HOP' but no assignment is done
-W: 39:define_constant: Global variable 'SOMEVAR' undefined at the module level
diff --git a/test/messages/func_missing_super_argument_py_30.txt b/test/messages/func_missing_super_argument_py_30.txt
deleted file mode 100644
index 5c97f0d..0000000
--- a/test/messages/func_missing_super_argument_py_30.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-E: 8:MyClass.__init__: Missing argument to super()
-R: 5:MyClass: Too few public methods (0/2)
diff --git a/test/messages/func_newstyle_exceptions.txt b/test/messages/func_newstyle_exceptions.txt
deleted file mode 100644
index 305326c..0000000
--- a/test/messages/func_newstyle_exceptions.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-E: 25:fonctionNew: Raising a new style class which doesn't inherit from BaseException
-E: 33:fonctionNew2: Raising a new style class which doesn't inherit from BaseException
-E: 37:fonctionNotImplemented: NotImplemented raised - should raise NotImplementedError
-W: 21:fonctionBof: Exception doesn't inherit from standard "Exception" class
-W: 29:fonctionBof2: Exception doesn't inherit from standard "Exception" class
-W: 29:fonctionBof2: Use raise ErrorClass(args) instead of raise ErrorClass, args.
-W: 37:fonctionNotImplemented: Use raise ErrorClass(args) instead of raise ErrorClass, args.
diff --git a/test/messages/func_newstyle_exceptions_py30.txt b/test/messages/func_newstyle_exceptions_py30.txt
deleted file mode 100644
index ed4ba4d..0000000
--- a/test/messages/func_newstyle_exceptions_py30.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-E: 21:fonctionBof: Raising a new style class which doesn't inherit from BaseException
-E: 25:fonctionNew: Raising a new style class which doesn't inherit from BaseException
-E: 29:fonctionBof2: Raising a new style class which doesn't inherit from BaseException
-E: 33:fonctionNew2: Raising a new style class which doesn't inherit from BaseException
-E: 37:fonctionNotImplemented: NotImplemented raised - should raise NotImplementedError
diff --git a/test/messages/func_newstyle_property.txt b/test/messages/func_newstyle_property.txt
deleted file mode 100644
index ba6018f..0000000
--- a/test/messages/func_newstyle_property.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-C: 14:HaNonNonNon: Old-style class defined.
-W: 16:HaNonNonNon: Use of "property" on an old style class
diff --git a/test/messages/func_newstyle_property_py30.txt b/test/messages/func_newstyle_property_py30.txt
deleted file mode 100644
index e69de29..0000000
--- a/test/messages/func_newstyle_property_py30.txt
+++ /dev/null
diff --git a/test/messages/func_newstyle_super.txt b/test/messages/func_newstyle_super.txt
deleted file mode 100644
index ce71293..0000000
--- a/test/messages/func_newstyle_super.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-C: 7:Aaaa: Old-style class defined.
-E: 9:Aaaa.hop: Use of super on an old style class
-E: 13:Aaaa.__init__: Use of super on an old style class
-E: 23:NewAaaa.__init__: Bad first argument 'object' given to super()
-E: 28:Py3kAaaa.__init__: Missing argument to super()
-E: 33:Py3kWrongSuper.__init__: Bad first argument 'NewAaaa' given to super()
-E: 38:WrongNameRegression.__init__: Bad first argument 'Missing' given to super()
-E: 47:CrashSuper.__init__: Bad first argument 'NewAaaa' given to super() \ No newline at end of file
diff --git a/test/messages/func_newstyle_super_py30.txt b/test/messages/func_newstyle_super_py30.txt
deleted file mode 100644
index ecabca5..0000000
--- a/test/messages/func_newstyle_super_py30.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-E: 23:NewAaaa.__init__: Bad first argument 'object' given to super()
-E: 33:Py3kWrongSuper.__init__: Bad first argument 'NewAaaa' given to super()
-E: 38:WrongNameRegression.__init__: Bad first argument 'Missing' given to super()
-E: 47:CrashSuper.__init__: Bad first argument 'NewAaaa' given to super() \ No newline at end of file
diff --git a/test/test_func.py b/test/test_func.py
index 225efc8..887ffe4 100644
--- a/test/test_func.py
+++ b/test/test_func.py
@@ -45,7 +45,9 @@ class LintTestNonExistentModuleTC(LintTestUsingModule):
class TestTests(testlib.TestCase):
"""check that all testable messages have been checked"""
PORTED = set(['I0001', 'I0010', 'W0712', 'E1001', 'W1402', 'E1310', 'E0202',
- 'W0711', 'W0108', 'C0112'])
+ 'W0711', 'W0108', 'E0603', 'W0710', 'E0710', 'E0711', 'W1001',
+ 'E1124', 'E1120', 'E1121', 'E1123', 'E1003', 'E1002', 'W0212',
+ 'W0109', 'E1004', 'W0604', 'W0601', 'W0602', 'C0112', 'C0330'])
@testlib.tag('coverage')
def test_exhaustivity(self):