Commit f3cb57d5 authored by Michele Tartara's avatar Michele Tartara
Browse files

Prevent lint error in mocked classes

Accessing private methods of parent classes is bad, but it is sometimes the best
approach for classes mocking them for testing reasons.
Selectively disable the related lint error just for the few functions that need
to do it.
Signed-off-by: default avatarMichele Tartara <>
Reviewed-by: default avatarJose A. Lopes <>
parent 317a3fdb
......@@ -31,6 +31,7 @@ class LockManagerMock(locking.GanetiLockManager):
def __init__(self):
# reset singleton instance, there is a separate lock manager for every test
# pylint: disable=W0212
self.__class__._instance = None
super(LockManagerMock, self).__init__([], [], [], [])
......@@ -79,6 +79,7 @@ class ProcessorMock(mcpu.Processor):
return self.ExecOpCode(op, LogRecordingCallback(self))
def _ExecLU(self, lu):
# pylint: disable=W0212
if not self._lu_test_func:
return super(ProcessorMock, self)._ExecLU(lu)
......@@ -87,6 +88,7 @@ class ProcessorMock(mcpu.Processor):
return self._lu_test_func(lu)
def _CheckLUResult(self, op, result):
# pylint: disable=W0212
if not self._lu_test_func:
return super(ProcessorMock, self)._CheckLUResult(op, result)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment