"""Test bootstrap: never touch the real BoltClam profile or Downloads.""" from __future__ import annotations import os import sys from pathlib import Path os.environ.setdefault("QT_QPA_PLATFORM", "offscreen") ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(ROOT / "src")) import pytest # noqa: E402 from boltclam import paths # noqa: E402 @pytest.fixture def isolated_env(tmp_path: Path, monkeypatch) -> Path: monkeypatch.setenv("BOLTCLAM_CONFIG_DIR", str(tmp_path / "config")) monkeypatch.setenv("BOLTCLAM_DATA_DIR", str(tmp_path / "data")) paths.ensure_dirs() return tmp_path @pytest.fixture(scope="session") def qapp(): from PyQt6.QtWidgets import QApplication app = QApplication.instance() or QApplication([]) return app