diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2014-04-18 09:27:01 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2014-04-18 09:27:01 +0200 |
commit | 5e39be38b66d9063bbfb68e1b4fc61b32a5b0a66 (patch) | |
tree | 28e51be4a70f1fc1fa8f8bbb74786dae8b290566 /test/test_logging.py | |
parent | ec76d962a282fdc68045ef81f9c6602d7734e436 (diff) | |
download | pylint-5e39be38b66d9063bbfb68e1b4fc61b32a5b0a66.tar.gz |
[test] rename test modules
Diffstat (limited to 'test/test_logging.py')
-rw-r--r-- | test/test_logging.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/test/test_logging.py b/test/test_logging.py deleted file mode 100644 index cbacada..0000000 --- a/test/test_logging.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2014 Google Inc. All Rights Reserved. -""" -Unittest for the logging checker. -""" -from logilab.common.testlib import unittest_main -from astroid import test_utils - -from pylint.checkers import logging - -from pylint.testutils import CheckerTestCase, Message, set_config - - -class LoggingModuleDetectionTest(CheckerTestCase): - CHECKER_CLASS = logging.LoggingChecker - - def test_detects_standard_logging_module(self): - stmts = test_utils.extract_node(""" - import logging #@ - logging.warn('%s' % '%s') #@ - """) - self.checker.visit_module(None) - self.checker.visit_import(stmts[0]) - with self.assertAddsMessages(Message('logging-not-lazy', node=stmts[1])): - self.checker.visit_callfunc(stmts[1]) - - def test_detects_renamed_standard_logging_module(self): - stmts = test_utils.extract_node(""" - import logging as blogging #@ - blogging.warn('%s' % '%s') #@ - """) - self.checker.visit_module(None) - self.checker.visit_import(stmts[0]) - with self.assertAddsMessages(Message('logging-not-lazy', node=stmts[1])): - self.checker.visit_callfunc(stmts[1]) - - @set_config(logging_modules=['logging', 'my.logging']) - def test_nonstandard_logging_module(self): - stmts = test_utils.extract_node(""" - from my import logging as blogging #@ - blogging.warn('%s' % '%s') #@ - """) - self.checker.visit_module(None) - self.checker.visit_import(stmts[0]) - with self.assertAddsMessages(Message('logging-not-lazy', node=stmts[1])): - self.checker.visit_callfunc(stmts[1]) - - -if __name__ == '__main__': - unittest_main() |