Phase 1 : enrichit chaque clic avec som_element (id, label, bbox) via YOLO+docTR Phase 2 : nouvelle résolution SoM+VLM — SomEngine numérote, VLM identifie le mark 10 tests unitaires ajoutés, conftest unit/ pour le bon path agent_v0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
756 B
Python
27 lines
756 B
Python
"""Conftest pour les tests unitaires.
|
|
|
|
Force le bon chemin agent_v0 (rpa_vision_v3) pour éviter les conflits
|
|
avec ~/ai/agent_v0 (standalone).
|
|
"""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = str(Path(__file__).resolve().parents[2])
|
|
|
|
if ROOT in sys.path:
|
|
sys.path.remove(ROOT)
|
|
sys.path.insert(0, ROOT)
|
|
|
|
# Si agent_v0 est déjà chargé depuis le mauvais chemin, le remplacer
|
|
_agent_mod = sys.modules.get("agent_v0")
|
|
if _agent_mod and not getattr(_agent_mod, "__file__", "").startswith(ROOT):
|
|
to_remove = [k for k in sys.modules if k == "agent_v0" or k.startswith("agent_v0.")]
|
|
for k in to_remove:
|
|
del sys.modules[k]
|
|
|
|
# Pré-importer le bon agent_v0.server_v1
|
|
try:
|
|
import agent_v0.server_v1 # noqa: F401
|
|
except ImportError:
|
|
pass
|