"""Pytest configuration — must run BEFORE any test imports project modules. Adds the xiaozhi-server directory to sys.path so the existing implicit relative imports (`from core.utils.textUtils import ...`) resolve. """ import sys from pathlib import Path _PROJECT_ROOT = Path(__file__).resolve().parent.parent if str(_PROJECT_ROOT) not in sys.path: sys.path.insert(0, str(_PROJECT_ROOT))