Skip to content

Commit

Permalink
Minor changes to path.
Browse files Browse the repository at this point in the history
  • Loading branch information
jf514 committed Sep 30, 2024
1 parent 6c3e555 commit 508a0c5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/integration/test_model.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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):
Expand Down

0 comments on commit 508a0c5

Please sign in to comment.