import pytest from thoughtsync.config import Config @pytest.fixture(autouse=True) def _isolated_data_dir(tmp_path, monkeypatch): """Keep any media writes on an isolated temp dir rather than the fixed /var/thoughtsync. DB-free unit tests never actually hit it (create_app takes its signing key from env-or-random, not a file), but this stays defensive.""" monkeypatch.setattr(Config, "DATA_DIR", str(tmp_path / "data")) yield