diff --git a/tests/conftest.py b/tests/conftest.py index b69ba949..7ede5cd4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,8 +8,9 @@ def pytest_addoption(parser): parser.addoption( '--generate-expected', action='store_true', default=False, # dest='generate_expected', help='If True, it generates the expected files instead of running the tests. Default: False.', - - '--api-version', type=string, default=getenv('WORKER_API_VER', default='v1'), + ) + parser.addoption( + '--api-version', type=str, default=getenv('WORKER_API_VER', default='v1'), help='Set the OasisAPI clients api version [v1, v2]' ) diff --git a/tests/modelcheck.py b/tests/modelcheck.py index 8590ff91..bb068b18 100644 --- a/tests/modelcheck.py +++ b/tests/modelcheck.py @@ -51,7 +51,7 @@ @pytest.fixture(scope='module') -def wait_for_api(module_scoped_container_getter): +def wait_for_api(module_scoped_container_getter, request): """ Fixture that waits for the docker container running the OasisAPI to become responsive. see https://github.com/pytest-docker-compose/pytest-docker-compose for details on using @@ -76,7 +76,7 @@ def wait_for_api(module_scoped_container_getter): # Wait for server request_session.mount('http://', HTTPAdapter(max_retries=retries)) server = module_scoped_container_getter.get("server").network_info[0] - api_ver = request.config.getoption('--api-version', 'v1') + api_ver = request.config.getoption('--api-version', 'v1') api_url = f"http://{server.hostname}:{server.host_port}" assert request_session.get(f"{api_url}/healthcheck/") @@ -193,7 +193,7 @@ def setUpClass(cls, expected_dir=None, input_tar=None, results_tar=None, params= # skip run if paramters are missing if not cls.params: - pytest.skip(f"Skipping TestClass={cls.__name__}, no input files set in params") + pytest.skip(f"Skipping TestClass={cls.__name__}, no input files set in params") # Find PiWind's model id cls.model_id = cls._get_model_id(cls)