mirror of
https://github.com/meta-llama/llama-stack.git
synced 2026-01-03 00:22:14 +00:00
address comments
This commit is contained in:
parent
c03f7fe9be
commit
d19526ecd7
7 changed files with 127 additions and 124 deletions
|
|
@ -8,8 +8,8 @@ import pytest
|
|||
|
||||
from ..conftest import (
|
||||
get_provider_fixture_overrides,
|
||||
get_provider_fixtures_from_config,
|
||||
try_load_config_file_cached,
|
||||
get_provider_fixture_overrides_from_test_config,
|
||||
get_test_config_for_api,
|
||||
)
|
||||
|
||||
from ..inference.fixtures import INFERENCE_FIXTURES
|
||||
|
|
@ -69,21 +69,11 @@ def pytest_configure(config):
|
|||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
test_config = try_load_config_file_cached(metafunc.config)
|
||||
provider_fixtures_config = (
|
||||
test_config.memory.fixtures.provider_fixtures
|
||||
if test_config is not None and test_config.memory is not None
|
||||
else None
|
||||
)
|
||||
custom_fixtures = (
|
||||
get_provider_fixtures_from_config(
|
||||
provider_fixtures_config, DEFAULT_PROVIDER_COMBINATIONS
|
||||
)
|
||||
if provider_fixtures_config is not None
|
||||
else None
|
||||
)
|
||||
test_config = get_test_config_for_api(metafunc.config, "memory")
|
||||
if "embedding_model" in metafunc.fixturenames:
|
||||
model = metafunc.config.getoption("--embedding-model")
|
||||
model = getattr(test_config, "embedding_model", None)
|
||||
# Fall back to the default if not specified by the config file
|
||||
model = model or metafunc.config.getoption("--embedding-model")
|
||||
if model:
|
||||
params = [pytest.param(model, id="")]
|
||||
else:
|
||||
|
|
@ -97,7 +87,9 @@ def pytest_generate_tests(metafunc):
|
|||
"memory": MEMORY_FIXTURES,
|
||||
}
|
||||
combinations = (
|
||||
custom_fixtures
|
||||
get_provider_fixture_overrides_from_test_config(
|
||||
metafunc.config, "memory", DEFAULT_PROVIDER_COMBINATIONS
|
||||
)
|
||||
or get_provider_fixture_overrides(metafunc.config, available_fixtures)
|
||||
or DEFAULT_PROVIDER_COMBINATIONS
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue