"""Pytest configuration — add src and project root to sys.path for imports.""" import sys from pathlib import Path # Add both the src dir and project root so tests can import from # both package-style (from src.midi.handler import ...) and # entry-point-style (from main import ...) PROJECT_ROOT = Path(__file__).resolve().parent.parent SRC = PROJECT_ROOT / "src" for p in [SRC, PROJECT_ROOT]: if str(p) not in sys.path: sys.path.insert(0, str(p))