Skip to content
Python

test(core): skip fixtures that are absent from the public snapshot (#112)

u7-u7b6e6a3fb43fc
diff --git a/memhub/apps/core/tests/test_context_raw_scale_benchmark.py b/memhub/apps/core/tests/test_context_raw_scale_benchmark.py
index 184aeef..34909d8 100644
--- a/memhub/apps/core/tests/test_context_raw_scale_benchmark.py
+++ b/memhub/apps/core/tests/test_context_raw_scale_benchmark.py
@@ -8,6 +8,11 @@ import pytest
pytestmark = [pytest.mark.performance, pytest.mark.serial]
SCRIPT = Path(__file__).resolve().parents[3] / "scripts" / "bench_context_raw_scale.py"
+if not SCRIPT.exists():
+ pytest.skip(
+ f"benchmark script is not part of this checkout: {SCRIPT.name}",
+ allow_module_level=True,
+ )
spec = importlib.util.spec_from_file_location("bench_context_raw_scale", SCRIPT)
benchmark = importlib.util.module_from_spec(spec)
sys.modules["bench_context_raw_scale"] = benchmark
diff --git a/memhub/apps/core/tests/test_processing_requests.py b/memhub/apps/core/tests/test_processing_requests.py
index 3ab4c47..30f8420 100644
--- a/memhub/apps/core/tests/test_processing_requests.py
+++ b/memhub/apps/core/tests/test_processing_requests.py
@@ -8,8 +8,11 @@ from uuid import UUID
import pytest
from pydantic import ValidationError
-import one_memory.processing_requests as requests_module
-from one_memory.processing_requests import (
+requests_module = pytest.importorskip(
+ "one_memory.processing_requests",
+ reason="processing-request store is not part of the public Core snapshot",
+)
+from one_memory.processing_requests import ( # noqa: E402 - importorskip must run first
ProcessingRequest,
ProcessingRequestConflictError,
ProcessingRequestState,
diff --git a/memhub/apps/core/tests/test_raw_vector_scale_benchmark.py b/memhub/apps/core/tests/test_raw_vector_scale_benchmark.py
index 6bcf1b3..7f411b4 100644
--- a/memhub/apps/core/tests/test_raw_vector_scale_benchmark.py
+++ b/memhub/apps/core/tests/test_raw_vector_scale_benchmark.py
@@ -7,6 +7,11 @@ import pytest
pytestmark = [pytest.mark.performance, pytest.mark.serial]
SCRIPT = Path(__file__).resolve().parents[3] / "scripts" / "bench_raw_vector_scale.py"
+if not SCRIPT.exists():
+ pytest.skip(
+ f"benchmark script is not part of this checkout: {SCRIPT.name}",
+ allow_module_level=True,
+ )
spec = importlib.util.spec_from_file_location("bench_raw_vector_scale", SCRIPT)
benchmark = importlib.util.module_from_spec(spec)
sys.modules["bench_raw_vector_scale"] = benchmark
diff --git a/memhub/apps/core/tests/test_retrieval_eligibility_benchmark.py b/memhub/apps/core/tests/test_retrieval_eligibility_benchmark.py
index 4a49eb2..595d6b2 100644
--- a/memhub/apps/core/tests/test_retrieval_eligibility_benchmark.py
+++ b/memhub/apps/core/tests/test_retrieval_eligibility_benchmark.py
@@ -8,6 +8,11 @@ import pytest
pytestmark = [pytest.mark.performance, pytest.mark.serial]
SCRIPT = Path(__file__).resolve().parents[3] / "scripts" / "bench_retrieval_eligibility_scale.py"
+if not SCRIPT.exists():
+ pytest.skip(
+ f"benchmark script is not part of this checkout: {SCRIPT.name}",
+ allow_module_level=True,
+ )
spec = importlib.util.spec_from_file_location("bench_retrieval_eligibility_scale", SCRIPT)
benchmark = importlib.util.module_from_spec(spec)
sys.modules["bench_retrieval_eligibility_scale"] = benchmark