from __future__ import annotations

import sys
from pathlib import Path

import pytest

ROOT = Path(__file__).resolve().parents[1]
SRC = ROOT / "src"
if str(SRC) not in sys.path:
    sys.path.insert(0, str(SRC))


@pytest.fixture(autouse=True)
def _clear_runner_cache():
    from g_gremlin_dynamics_mcp import runner

    runner.clear_gremlin_path_cache()
    yield
    runner.clear_gremlin_path_cache()
