mirror of
https://github.com/nix-community/nix-direnv.git
synced 2024-09-11 11:35:54 +03:00
19 lines
517 B
Python
19 lines
517 B
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
pytest_plugins = [
|
|
"tests.direnv_project",
|
|
"tests.root",
|
|
]
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _cleanenv(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
|
# so direnv doesn't touch $HOME
|
|
monkeypatch.setenv("HOME", str(tmp_path / "home"))
|
|
# so direnv allow state writes under tmp HOME
|
|
monkeypatch.delenv("XDG_DATA_HOME", raising=False)
|
|
# so direnv does not pick up user customization
|
|
monkeypatch.delenv("XDG_CONFIG_HOME", raising=False)
|