"""Shared pytest fixtures and sys.path bootstrap for the test suite. Ensures both the `api` package (repo root) and the `absa` package (src-layout) are importable regardless of how pytest is invoked, so no ``PYTHONPATH`` environment hacks are required. """ from __future__ import annotations import sys from pathlib import Path import pytest _REPO_ROOT = Path(__file__).resolve().parent.parent _SRC_DIR = _REPO_ROOT / "src" for _path in (_REPO_ROOT, _SRC_DIR): if str(_path) not in sys.path: sys.path.insert(0, str(_path)) @pytest.fixture(autouse=True) def _no_network() -> None: """Fixture placeholder for suite-wide guards (e.g. disable telemetry).""" yield