Commit 65d26f1d by Ned Batchelder

Remove deprecation warnings

parent 8ed6d5fa
"""Pylint plugin: test classes derived from test classes.""" """Pylint plugin: test classes derived from test classes."""
import astroid import astroid
from astroid.scoped_nodes import get_locals # not sure this is the right import
from pylint.checkers import BaseChecker, utils from pylint.checkers import BaseChecker, utils
from pylint.interfaces import IAstroidChecker from pylint.interfaces import IAstroidChecker
...@@ -41,7 +42,7 @@ class LayeredTestClassChecker(BaseChecker): ...@@ -41,7 +42,7 @@ class LayeredTestClassChecker(BaseChecker):
if not node.is_subtype_of('unittest.case.TestCase'): if not node.is_subtype_of('unittest.case.TestCase'):
return False return False
dunder_test = node.locals.get("__test__") dunder_test = get_locals(node).get("__test__")
if dunder_test: if dunder_test:
if isinstance(dunder_test[0], astroid.AssName): if isinstance(dunder_test[0], astroid.AssName):
value = list(dunder_test[0].assigned_stmts()) value = list(dunder_test[0].assigned_stmts())
......
...@@ -76,7 +76,7 @@ class AssertChecker(BaseChecker): ...@@ -76,7 +76,7 @@ class AssertChecker(BaseChecker):
""" """
Check that various assertTrue/False functions are not misused. Check that various assertTrue/False functions are not misused.
""" """
if not isinstance(node.func, astroid.Getattr): if not isinstance(node.func, astroid.Attribute):
# If it isn't a getattr ignore this. All the assertMethods are # If it isn't a getattr ignore this. All the assertMethods are
# attributes of self: # attributes of self:
return return
......
...@@ -17,7 +17,6 @@ def load_tests(unused_loader, tests, unused_pattern): ...@@ -17,7 +17,6 @@ def load_tests(unused_loader, tests, unused_pattern):
# Load our plugin. # Load our plugin.
linter.load_plugin_modules(['edx_lint.pylint']) linter.load_plugin_modules(['edx_lint.pylint'])
linter.global_set_option('required-attributes', ())
here = os.path.dirname(os.path.abspath(__file__)) here = os.path.dirname(os.path.abspath(__file__))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment