"""Shared fixtures: every test gets an isolated CA data dir (settings is a process-wide singleton → patched).""" from __future__ import annotations from pathlib import Path import pytest from countryatlas.config import settings FIXTURES = Path(__file__).parent / "fixtures" @pytest.fixture() def data_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: d = tmp_path / "ca-data" monkeypatch.setattr(settings, "data_dir", d) settings.ensure_dirs() return d @pytest.fixture() def fixtures() -> Path: return FIXTURES