diff --git a/data-pipeline/capture/tests/test_config_models_hypothesis.py b/data-pipeline/capture/tests/test_config_models_hypothesis.py index 83a8390a..b35b1170 100644 --- a/data-pipeline/capture/tests/test_config_models_hypothesis.py +++ b/data-pipeline/capture/tests/test_config_models_hypothesis.py @@ -1,9 +1,20 @@ """Hypothesis property-based tests for ROS 2 edge recording configuration models.""" +import sys import tempfile +from pathlib import Path import pytest -from common.config_models import ( +from hypothesis import assume, given +from hypothesis import strategies as st +from pydantic import ValidationError + +# data-pipeline contains a hyphen, making it an invalid Python package name. +_CAPTURE_DIR = str(Path(__file__).resolve().parent.parent) +if _CAPTURE_DIR not in sys.path: + sys.path.insert(0, _CAPTURE_DIR) + +from models.config_models import ( DiskThresholds, GapDetectionConfig, GpioTriggerConfig, @@ -12,9 +23,6 @@ TopicConfig, VrTriggerConfig, ) -from hypothesis import assume, given -from hypothesis import strategies as st -from pydantic import ValidationError @given( diff --git a/pyproject.toml b/pyproject.toml index 845055f1..894457d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,6 +82,7 @@ select = [ "training/rl/scripts/rsl_rl/*.py" = ["E402"] "data-management/viewer/backend/tests/*.py" = ["E402"] "data-pipeline/capture/tests/test_config_models.py" = ["E402"] +"data-pipeline/capture/tests/test_config_models_hypothesis.py" = ["E402"] [tool.ruff.lint.isort] known-first-party = ["training"] diff --git a/data-pipeline/capture/tests/test_cli_args.py b/training/tests/test_cli_args.py similarity index 96% rename from data-pipeline/capture/tests/test_cli_args.py rename to training/tests/test_cli_args.py index ed79974b..85fcf1d0 100644 --- a/data-pipeline/capture/tests/test_cli_args.py +++ b/training/tests/test_cli_args.py @@ -6,7 +6,12 @@ from types import SimpleNamespace import pytest -from common.cli_args import add_rsl_rl_args, update_rsl_rl_cfg + +from .conftest import load_training_module + +_CLI_ARGS = load_training_module("training_rl_cli_args", "training/rl/cli_args.py") +add_rsl_rl_args = _CLI_ARGS.add_rsl_rl_args +update_rsl_rl_cfg = _CLI_ARGS.update_rsl_rl_cfg class TestAddRslRlArgs: