From e4808939d8841e4de277d2c99f04442a97a7a12f Mon Sep 17 00:00:00 2001 From: Vikyek Date: Wed, 20 May 2026 17:17:15 +0200 Subject: [PATCH] tests: Clear XDG environment variables in tests Clear XDG_CACHE_HOME and XDG_DATA_HOME in the default test environment to prevent host environment variables from leaking into tests. This fixes path assertion failures when these variables are set on the host system, as Protontricks uses them to determine cache and data locations even when HOME is mocked. --- tests/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index f466fa6..74421e7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -30,6 +30,8 @@ def default_env(monkeypatch): """ monkeypatch.setenv("STEAM_RUNTIME", "") monkeypatch.delenv("XDG_CONFIG_HOME", raising=False) + monkeypatch.delenv("XDG_CACHE_HOME", raising=False) + monkeypatch.delenv("XDG_DATA_HOME", raising=False) monkeypatch.setattr("protontricks.steam.COMMON_COMPAT_TOOL_DIRS", [])