Skip to content

Commit ff59b10

Browse files
committed
keep $HOME out of tests more thoroughly
1 parent 1343d3c commit ff59b10

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
from os import environ
12
from pathlib import Path
23

34
import pytest
45

56

67
@pytest.fixture(autouse=True)
78
def no_homedir_fixture(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
8-
monkeypatch.setattr("qbpm.paths.default_qbpm_application_dir", lambda: tmp_path)
9-
monkeypatch.setattr("qbpm.paths.default_profile_dir", lambda: tmp_path)
9+
environ["XDG_CONFIG_HOME"] = str(tmp_path)
10+
environ["XDG_DATA_HOME"] = str(tmp_path)
11+
monkeypatch.setattr("qbpm.paths.get_app_dir", lambda *_args, **_kwargs: tmp_path)
12+
monkeypatch.setattr("qbpm.paths.Path.home", lambda: tmp_path)

0 commit comments

Comments
 (0)