From 47c0f4ff73948730911341731e811b5dbe9f9cf7 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Sat, 2 May 2026 08:34:45 +0900 Subject: [PATCH] fix(nanoclaude): tests/conftest also adds gpu-services root for infra/ infra/ lives at the repo root, not inside nanoclaude/. The Dockerfile copies it to /app/infra so tools.infra_tool can `from infra.core...`. Mirror the in-container PYTHONPATH in conftest so the integration test module can be imported outside Docker. Co-Authored-By: Claude Opus 4.7 (1M context) --- nanoclaude/tests/conftest.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/nanoclaude/tests/conftest.py b/nanoclaude/tests/conftest.py index fafb801..5cc1629 100644 --- a/nanoclaude/tests/conftest.py +++ b/nanoclaude/tests/conftest.py @@ -1,5 +1,8 @@ -"""pytest configuration — pin nanoclaude/ on sys.path so tests can use the -same `services.x` imports the running app does. +"""pytest configuration — match the in-container PYTHONPATH so tests can use +the same `services.x` and `infra.core.x` imports the running app does. + +The Dockerfile copies ``nanoclaude/`` to /app/ and ``infra/`` to /app/infra/, +so /app is on PYTHONPATH and both packages resolve. Mirror that here. """ from __future__ import annotations @@ -8,5 +11,8 @@ import sys from pathlib import Path NANOCLAUDE_ROOT = Path(__file__).resolve().parent.parent -if str(NANOCLAUDE_ROOT) not in sys.path: - sys.path.insert(0, str(NANOCLAUDE_ROOT)) +GPU_SERVICES_ROOT = NANOCLAUDE_ROOT.parent + +for path in (NANOCLAUDE_ROOT, GPU_SERVICES_ROOT): + if str(path) not in sys.path: + sys.path.insert(0, str(path))