diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-04 00:37:54 +0200 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-04 00:37:54 +0200 |
commit | dcf7e19a00fdbdf00d3d3f6b27eb68c21365680d (patch) | |
tree | ce7c8c752799217d197424956756dee51ae6ffc2 /checkers/stdlib.py | |
parent | 54b3d9f0c9698dbd99f4c9b521f3e4567d5085c4 (diff) | |
download | pylint-dcf7e19a00fdbdf00d3d3f6b27eb68c21365680d.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.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/checkers/stdlib.py b/checkers/stdlib.py index 8f1965e..216d640 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): |