"""Shared test fixtures.""" from __future__ import annotations from pathlib import Path import pytest @pytest.fixture def data_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: """Point config path constants at a temporary data directory.""" variants = tmp_path / "variants" intermediates = tmp_path / "intermediates" meta = tmp_path / "meta" inbox = tmp_path / "incoming" webcache = tmp_path / "webcache" for directory in (variants, intermediates, meta, inbox, webcache): directory.mkdir() monkeypatch.setattr("app.config.DATA_DIR", tmp_path) monkeypatch.setattr("app.config.VARIANTS_DIR", variants) monkeypatch.setattr("app.config.INTERMEDIATES_DIR", intermediates) monkeypatch.setattr("app.config.META_DIR", meta) monkeypatch.setattr("app.config.INBOX_DIR", inbox) monkeypatch.setattr("app.config.WEB_CACHE_DIR", webcache) monkeypatch.setattr("app.config.PROCESSED_FILE", tmp_path / "processed.json") return tmp_path