diff options
Diffstat (limited to 'tests_e2e/conftest.py')
-rw-r--r-- | tests_e2e/conftest.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests_e2e/conftest.py b/tests_e2e/conftest.py new file mode 100644 index 0000000..8cb85f7 --- /dev/null +++ b/tests_e2e/conftest.py @@ -0,0 +1,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)) |