third_party.pylibs.pylint.src/pylint/test/input/func_bug113231.py
ssolanki 5673ffe2d8 adapt existing test cases for useless-object-inheritance.
adapt existing test/input test cases to new check.

add some more positive test case for useless-object-inheritance

msg code was in conflict with existing msg.

adapt existing test cases for new checker.
2018-06-21 11:17:27 +05:30

25 lines
587 B
Python

# pylint: disable=E1101
# pylint: disable=C0103
# pylint: disable=R0903, useless-object-inheritance
"""test bugfix for #113231 in logging checker
"""
from __future__ import absolute_import
# Muck up the names in an effort to confuse...
import logging as renamed_logging
__revision__ = ''
class Logger(object):
"""Fake logger"""
pass
logger = renamed_logging.getLogger(__name__)
fake_logger = Logger()
# Statements that should be flagged:
renamed_logging.warning('%s, %s' % (4, 5))
logger.warning('%s' % 5)
# Statements that should not be flagged:
fake_logger.warn('%s' % 5)