third_party.pylibs.pylint.src/pylint/test/input/func_noerror_class_attributes.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

19 lines
434 B
Python

"""Test that valid class attribute doesn't trigger errors"""
__revision__ = 'sponge bob'
# pylint: disable=useless-object-inheritance
class Clazz(object):
"dummy class"
def __init__(self):
self.topic = 5
self._data = 45
def change_type(self, new_class):
"""Change type"""
self.__class__ = new_class
def do_nothing(self):
"I do nothing useful"
return self.topic + 56