Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sambles committed Dec 5, 2023
1 parent fed6489 commit ca035ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]'
)

Expand Down
6 changes: 3 additions & 3 deletions tests/modelcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/")

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ca035ff

Please sign in to comment.