11import importlib
22import os
3+ from pathlib import Path
34
45import pytest
56import structlog
@@ -20,13 +21,14 @@ async def test_error_match_db(engine: AsyncEngine) -> None:
2021 fake error which is not in the database.
2122 """
2223
24+ fixtures = Path (__file__ ).parent .parent / "fixtures" / "seeds"
2325 interface = importlib .import_module ("lsst.cmservice.handlers.interface" )
2426 functions = importlib .import_module ("lsst.cmservice.handlers.functions" )
2527 logger = structlog .get_logger (__name__ )
2628 async with engine .begin ():
2729 session = await create_async_session (engine , logger )
2830 os .environ ["CM_CONFIGS" ] = "examples"
29- specification = await interface .load_specification (session , "examples /empty_config.yaml" )
31+ specification = await interface .load_specification (session , f" { fixtures } /empty_config.yaml" )
3032 check2 = await specification .get_block (session , "campaign" )
3133 assert check2 .name == "campaign"
3234
@@ -113,12 +115,13 @@ async def test_error_match_db(engine: AsyncEngine) -> None:
113115async def test_error_type_db (engine : AsyncEngine ) -> None :
114116 """Test `error_type` db table."""
115117
118+ fixtures = Path (__file__ ).parent .parent / "fixtures" / "seeds"
116119 interface = importlib .import_module ("lsst.cmservice.handlers.interface" )
117120 logger = structlog .get_logger (__name__ )
118121 async with engine .begin ():
119122 session = await create_async_session (engine , logger )
120123 os .environ ["CM_CONFIGS" ] = "examples"
121- specification = await interface .load_specification (session , "examples /empty_config.yaml" )
124+ specification = await interface .load_specification (session , f" { fixtures } /empty_config.yaml" )
122125 check2 = await specification .get_block (session , "campaign" )
123126 assert check2 .name == "campaign"
124127
0 commit comments