From 68183634bbe8e6c6af7a20e042229ce02360a6ef Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 20 May 2025 15:38:51 +0200 Subject: [PATCH] clan_cli flake_test: fix on non sandboxed runs --- pkgs/clan-cli/clan_lib/flake/flake_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/clan_lib/flake/flake_test.py b/pkgs/clan-cli/clan_lib/flake/flake_test.py index 0c665b0c8..3e182618d 100644 --- a/pkgs/clan-cli/clan_lib/flake/flake_test.py +++ b/pkgs/clan-cli/clan_lib/flake/flake_test.py @@ -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"