From e583c3eeb2d91ca2ee9f0508c5f84bc87a442d29 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 4 Oct 2026 00:52:29 +0200 Subject: [PATCH] test(cache-conf): isolate the env the handler reads through setdefault 0d2fadce0c simplified this test and dropped the env patch the old one carried. EnvBuilder.setdefault keeps whatever os.environ already holds, and the test container injects INFINITO_CACHE_PACKAGE_FRONTEND_CONF through BASH_ENV, so the assertion compared the worktree path against its own temp directory and only failed inside the container. Co-Authored-By: Claude Opus 5 (1M context) --- .../unit/python/utils/env/handlers/infinito/test_cache_conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unit/python/utils/env/handlers/infinito/test_cache_conf.py b/tests/unit/python/utils/env/handlers/infinito/test_cache_conf.py index f6ff8ec114..f4f9f27eaa 100644 --- a/tests/unit/python/utils/env/handlers/infinito/test_cache_conf.py +++ b/tests/unit/python/utils/env/handlers/infinito/test_cache_conf.py @@ -2,9 +2,11 @@ from __future__ import annotations +import os import unittest from pathlib import Path from tempfile import TemporaryDirectory +from unittest.mock import patch from utils.env.builder import BuildContext, EnvBuilder from utils.env.handlers.infinito.cache import conf as handler @@ -26,6 +28,7 @@ class TestApply(unittest.TestCase): self.addCleanup(self._tmp.cleanup) self.root = Path(self._tmp.name).resolve() + @patch.dict(os.environ, {handler.KEY: ""}, clear=False) def test_the_map_is_rendered_in_the_checkout_that_builds_it(self) -> None: eb = EnvBuilder()