Coverage for mlos_bench/mlos_bench/tests/config/conftest.py: 100%
8 statements
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-20 00:44 +0000
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-20 00:44 +0000
1#
2# Copyright (c) Microsoft Corporation.
3# Licensed under the MIT License.
4#
5"""Test fixtures for mlos_bench config loader tests."""
7import sys
9import pytest
11from mlos_bench.services.config_persistence import ConfigPersistenceService
12from mlos_bench.util import path_join
14if sys.version_info < (3, 10):
15 from importlib_resources import files
16else:
17 from importlib.resources import files
20@pytest.fixture
21def config_loader_service() -> ConfigPersistenceService:
22 """Config loader service fixture."""
23 return ConfigPersistenceService(
24 config={
25 "config_path": [
26 str(files("mlos_bench.tests.config")),
27 path_join(str(files("mlos_bench.tests.config")), "globals"),
28 ]
29 }
30 )