From 508a0c52d3a5d67f52c3f96095a7347dc8bd0613 Mon Sep 17 00:00:00 2001 From: Jason Foat Date: Mon, 30 Sep 2024 20:22:54 +0000 Subject: [PATCH] Minor changes to path. --- tests/integration/test_model.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/integration/test_model.py b/tests/integration/test_model.py index d78b5db..3ba86f0 100644 --- a/tests/integration/test_model.py +++ b/tests/integration/test_model.py @@ -1,9 +1,15 @@ +from pathlib import Path import pytest from dm_control import mjcf -from mujoco import mjx from stac_mjx.operations import mjx_load +from pathlib import Path + +# Define path roots +TEST_DIR = Path(__file__).parent +PROJECT_ROOT = TEST_DIR.parent.parent + def load_model(path: str): root = mjcf.from_path(path) @@ -14,17 +20,14 @@ def load_model(path: str): assert mjx_model is not None assert mjx_data is not None - # Fixtures @pytest.fixture def rodent_model(): - return "models/rodent.xml" + return str(PROJECT_ROOT / "models" / "rodent.xml") - -@pytest.fixture() +@pytest.fixture def mouse_model(): - return "models/mouse_with_meshes.xml" - + return str(PROJECT_ROOT / "models" / "mouse_with_meshes.xml") # Tests def test_rodent_load(rodent_model):