summaryrefslogtreecommitdiff
path: root/checkers/stdlib.py
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-01-04 00:37:54 +0200
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-01-04 00:37:54 +0200
commitf43d8bdd7c2f9fdc4836f0451ef9f578b54e72f4 (patch)
treedccd5a826526b5debebb1896b803c1872b9e5877 /checkers/stdlib.py
parente118080de3cc49762c8ab67fa6f73b0a2259cc57 (diff)
downloadpylint-git-f43d8bdd7c2f9fdc4836f0451ef9f578b54e72f4.tar.gz
Improve a couple of things for redundant-unittest-assert.
Include the bad assert method in the message and improve the test coverage. Also, annotate the test class with a skip decorator, since unittest discovery will believe it's an actual unittest file.
Diffstat (limited to 'checkers/stdlib.py')
-rw-r--r--checkers/stdlib.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/checkers/stdlib.py b/checkers/stdlib.py
index 8f1965eaf..216d640d5 100644
--- a/checkers/stdlib.py
+++ b/checkers/stdlib.py
@@ -93,13 +93,13 @@ class StdlibChecker(BaseChecker):
'midnight UTC. This behaviour was fixed in Python 3.5. '
'See http://bugs.python.org/issue13936 for reference.',
{'maxversion': (3, 5)}),
- 'W1503': ('Redundant use of assertTrue or assertFalse with constant '
+ 'W1503': ('Redundant use of %s with constant '
'value %r',
'redundant-unittest-assert',
'The first argument of assertTrue and assertFalse is'
'a condition. If a constant is passed as parameter, that'
'condition will be always true. In this case a warning '
- 'should be emited.')
+ 'should be emitted.')
}
@utils.check_messages('bad-open-mode', 'redundant-unittest-assert')
@@ -137,7 +137,7 @@ class StdlibChecker(BaseChecker):
isinstance(node.args[0], astroid.Const) and
infer.name in ['assertTrue', 'assertFalse']):
self.add_message('redundant-unittest-assert',
- args=(node.args[0].value, ),
+ args=(infer.name, node.args[0].value, ),
node=node)
def _check_datetime(self, node):