From b8ed6076584362ad2d4dfb88a5ac981e2b67a30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 9 Nov 2023 16:39:16 +0100 Subject: [PATCH] also override XDG_DATA_HOME in tests otherwise tests will fail if XDG_DATA_HOME is set by a user --- pkgs/clan-cli/tests/temporary_dir.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/clan-cli/tests/temporary_dir.py b/pkgs/clan-cli/tests/temporary_dir.py index 0b16c3fc1..026998206 100644 --- a/pkgs/clan-cli/tests/temporary_dir.py +++ b/pkgs/clan-cli/tests/temporary_dir.py @@ -21,6 +21,7 @@ def temporary_home(monkeypatch: pytest.MonkeyPatch) -> Iterator[Path]: else: with tempfile.TemporaryDirectory(prefix="pytest-") as dirpath: monkeypatch.setenv("HOME", str(dirpath)) + monkeypatch.setenv("XDG_DATA_HOME", str(Path(dirpath) / ".local/share")) monkeypatch.chdir(str(dirpath)) log.debug("Temp HOME directory: %s", str(dirpath)) yield Path(dirpath)