def METHOD_NAME(stack: ExitStack, version: Literal[2, 3, 4, 6]) -> ExitStack:
    stack.enter_context(
        patch(
            'rotkehlchen.globaldb.upgrades.manager.GLOBAL_DB_VERSION',
            version,
        ),
    )
    original_list = deepcopy(UPGRADES_LIST)
    stack.enter_context(
        patch(
            'rotkehlchen.globaldb.upgrades.manager.UPGRADES_LIST',
            original_list[:version - 2],
        ),
    )
    return stack