aboutsummaryrefslogtreecommitdiff
path: root/tests_e2e/conftest.py
blob: 8cb85f73130c8c26e307c0f83fe78943df8992e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Test configuration for the end-to-end tests."""
from typing import cast

import pytest


def pytest_addoption(parser: pytest.Parser) -> None:
    """Add command line options to control the e2e test behavior."""
    parser.addoption(
        "--no-skip",
        action="store_true",
        help="If set, forces tests to run regardless of the availability of "
        "MLIA backends required for the test. If not set, tests will be "
        "skipped if the required backend is not available.",
    )


@pytest.fixture(scope="session", name="no_skip")
def fixture_no_skip(request: pytest.FixtureRequest) -> bool:
    """Fixture for easy access to the '--no-skip' parameter."""
    return cast(bool, request.config.getoption("--no-skip", default=True))