

def test_command_global_init_should_ignore_marked_commands(self):
    inited = []

    class C0(Command):

        def __init__(self, dummy):
            super(C0, self).__init__(dummy, 'C0', 'C0 description')
            inited.append(self.__class__)

        def _process_command(self, lizy, args):
            pass

        def _get_name(self):
            pass

    class C1(C0):
        ignore_me = SubclassIgnoreMark('C1')

    class C2(C1):
        pass
    cmd_subparser = MagicMock()
    cmd_subparser.add_parser = MagicMock()
    Command.init_all(Pylease(None, cmd_subparser, None))
    ok_((C0 in inited))
    ok_((C1 not in ignore_me))
    ok_((C2 in inited))

dataset/ETHPy150Open n9code/pylease/tests/test_command.py CommandTest.test_command_global_init_should_ignore_marked_commands/VarMisuse@162/222 `inited`->`ignore_me`