"""Isolate user-dir lookups from the real %APPDATA% during tests.""" from __future__ import annotations import pytest @pytest.fixture(autouse=True) def _isolate_home(tmp_path_factory, monkeypatch): root = tmp_path_factory.mktemp("appdata") monkeypatch.setenv("APPDATA", str(root)) monkeypatch.delenv("XDG_CONFIG_HOME", raising=False)