mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 11:36:11 +01:00
18 lines
517 B
Python
18 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)
|