Run pylint on tests

Drop support for pylint < 1.0

Enable ignoring unknown attributes on modules (both nose and pytest
use advanced techniques, support for which only made it to pylint
recently)

Fix some bugs revealed by pylint

Do minor refactoring or add pylint:disable directives where the
linter complains.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
Petr Viktorin
2014-12-16 14:45:37 +01:00
committed by Tomas Babej
parent 10fe918acd
commit 61c4ecccc1
16 changed files with 77 additions and 66 deletions

View File

@@ -430,7 +430,7 @@ class ClassChecker(object):
def __get_cls(self):
if self.__cls is None:
self.__cls = self._cls
self.__cls = self._cls # pylint: disable=E1101
assert inspect.isclass(self.__cls)
return self.__cls
cls = property(__get_cls)
@@ -455,19 +455,6 @@ class ClassChecker(object):
context.__dict__.clear()
def check_TypeError(value, type_, name, callback, *args, **kw):
"""
Tests a standard TypeError raised with `errors.raise_TypeError`.
"""
e = raises(TypeError, callback, *args, **kw)
assert e.value is value
assert e.type is type_
assert e.name == name
assert type(e.name) is str
assert str(e) == ipalib.errors.TYPE_ERROR % (name, type_, value)
return e
def get_api(**kw):
"""
Returns (api, home) tuple.
@@ -503,7 +490,7 @@ class PluginTester(object):
def __get_plugin(self):
if self.__plugin is None:
self.__plugin = self._plugin
self.__plugin = self._plugin # pylint: disable=E1101
assert issubclass(self.__plugin, Plugin)
return self.__plugin
plugin = property(__get_plugin)