diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py index 1f17d9836..016767214 100644 --- a/tests/helpers/fixtures.py +++ b/tests/helpers/fixtures.py @@ -435,11 +435,11 @@ def data_tmpdir(monkeypatch, tmpdir): @pytest.fixture -def redirect_xdg_data(data_tmpdir): +def redirect_xdg_data(data_tmpdir, monkeypatch): """Set XDG_DATA_HOME to a temp location. While data_tmpdir covers most cases by redirecting standarddir.data(), this is not enough for places Qt references the data dir internally. For these, we need to set the environment variable to redirect data access. """ - os.putenv('XDG_DATA_HOME', str(data_tmpdir)) + monkeypatch.setenv('XDG_DATA_HOME', str(data_tmpdir))