clan_cli flake_test: fix on non sandboxed runs

This commit is contained in:
lassulus
2025-05-20 15:38:51 +02:00
parent 03990ef7f0
commit f7f3173224

View File

@@ -1,3 +1,4 @@
import contextlib
import logging
import subprocess
from pathlib import Path
@@ -373,7 +374,8 @@ def test_cache_gc(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setenv("NIX_STORE_DIR", str(tempdir / "store"))
monkeypatch.setenv("NIX_CACHE_HOME", str(tempdir / "cache"))
monkeypatch.setenv("HOME", str(tempdir / "home"))
monkeypatch.delenv("CLAN_TEST_STORE")
with contextlib.suppress(KeyError):
monkeypatch.delenv("CLAN_TEST_STORE")
monkeypatch.setenv("NIX_BUILD_TOP", str(tempdir / "build"))
test_file = tempdir / "flake" / "testfile"