Skip to content

Commit

Permalink
Teach pylint about unittest's setUp and tearDown names.
Browse files Browse the repository at this point in the history
This avoids needing to block out that warning once per TestCase
subclass.
  • Loading branch information
malcolmt committed Jun 16, 2010
1 parent d716b06 commit 5e7117c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions acacia/tests/test_models.py
Expand Up @@ -17,7 +17,7 @@ def setUp(self):
similar, but different paths and that some nodes appear multiple times
(and node "d" only appears once).
"""
# pylint: disable-msg=C0103,R0201
# pylint: disable-msg=R0201
nodes = ["a/b/c",
"a/x/c",
"c/b/d",
Expand All @@ -35,7 +35,6 @@ def setUp(self):
self.signals = []

def tearDown(self):
# pylint: disable-msg=C0103
self.signals = []

def signal_catcher(self, sender, **kwargs):
Expand Down
2 changes: 0 additions & 2 deletions acacia/tests/test_templatetags.py
Expand Up @@ -74,7 +74,6 @@ def test_html_sensitive_content(self):

class TreeTrunkSingleRootTests(test.TestCase):
def setUp(self):
# pylint: disable-msg=C0103
nodes = [
"root1/child1/grandchild1",
"root1/child1/grandchild2",
Expand Down Expand Up @@ -163,7 +162,6 @@ def test_default_level(self):

class TreeTrunkFullContentTests(test.TestCase):
def setUp(self):
# pylint: disable-msg=C0103
nodes = [
"root1/child1/grandchild1",
"root1/child1/grandchild2",
Expand Down
2 changes: 1 addition & 1 deletion pylint.rc
Expand Up @@ -141,7 +141,7 @@ class-rgx=[A-Z_][a-zA-Z0-9]+$
function-rgx=[a-z_][a-z0-9_]{2,30}$

# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
method-rgx=[a-z_][a-z0-9_]{2,30}$|setUp$|tearDown$

# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
Expand Down

0 comments on commit 5e7117c

Please sign in to comment.