From 082d4dbc45d798b6e50da49dfd83793a091c0262 Mon Sep 17 00:00:00 2001 From: lmalina Date: Mon, 22 Jan 2024 14:18:52 +0100 Subject: [PATCH] Should fix the path problem in tests --- tests/test_loco.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_loco.py b/tests/test_loco.py index bfee937..9422ca0 100644 --- a/tests/test_loco.py +++ b/tests/test_loco.py @@ -1,6 +1,7 @@ import at import numpy as np import pytest +from pathlib import Path from pySC.core.simulated_commissioning import SimulatedCommissioning from pySC.utils.sc_tools import SCgetOrds from pySC.utils import logging_tools @@ -8,6 +9,7 @@ from pySC.lattice_properties.response_model import SCgetModelRM, SCgetModelDispersion LOGGER = logging_tools.get_logger(__name__) +INPUTS = Path(__file__).parent / "inputs" def test_loco_hmba(at_ring): @@ -88,7 +90,7 @@ def test_loco_hmba(at_ring): @pytest.fixture def at_ring(): - ring = at.load_mat('inputs/hmba.mat') + ring = at.load_mat(f'{INPUTS}/hmba.mat') bpm_indexes = at.get_refpts(ring, at.elements.Monitor) for bpm_index in reversed(bpm_indexes): corrector = at.elements.Corrector(f'CXY{bpm_index}', length=0, kick_angle=[0, 0], PolynomA=[0, 0],