From ff59b109e8a9f3f5a5b1dae0a52adc8280c384e6 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Sun, 17 Aug 2025 18:23:46 -0400 Subject: [PATCH] keep $HOME out of tests more thoroughly --- tests/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index a977695..3939152 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,3 +1,4 @@ +from os import environ from pathlib import Path import pytest @@ -5,5 +6,7 @@ import pytest @pytest.fixture(autouse=True) def no_homedir_fixture(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setattr("qbpm.paths.default_qbpm_application_dir", lambda: tmp_path) - monkeypatch.setattr("qbpm.paths.default_profile_dir", lambda: tmp_path) + environ["XDG_CONFIG_HOME"] = str(tmp_path) + environ["XDG_DATA_HOME"] = str(tmp_path) + monkeypatch.setattr("qbpm.paths.get_app_dir", lambda *_args, **_kwargs: tmp_path) + monkeypatch.setattr("qbpm.paths.Path.home", lambda: tmp_path) -- 2.51.2