Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-lint
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-lint
Commits
65d26f1d
Commit
65d26f1d
authored
Aug 20, 2016
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecation warnings
parent
8ed6d5fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
edx_lint/pylint/layered_test_check.py
+2
-1
edx_lint/pylint/right_assert_check.py
+1
-1
test/test_pylint_plugins.py
+0
-1
No files found.
edx_lint/pylint/layered_test_check.py
View file @
65d26f1d
"""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
())
...
...
edx_lint/pylint/right_assert_check.py
View file @
65d26f1d
...
@@ -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
...
...
test/test_pylint_plugins.py
View file @
65d26f1d
...
@@ -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__
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment