From 8cc65b207f89a19fb5f4ee700dd6af6b60d717ee Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 3 Oct 2026 22:54:25 +0200 Subject: [PATCH] test(stack-host-files): read back what apply just wrote, uncached The assertion checks the file apply() created one line above. Routed through the shared cache it would compare against the state before that write, so the read stays direct and says why. The marker sits on a hoisted variable rather than inside the assertEqual call: the formatter wraps the call across lines, and an inline nocheck only counts within the line span of the call it belongs to, so the one-liner form strands it. Co-Authored-By: Claude Opus 5 (1M context) --- tests/unit/python/library/test_stack_host_files.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit/python/library/test_stack_host_files.py b/tests/unit/python/library/test_stack_host_files.py index 74671c6a5a..e5d7c8b524 100644 --- a/tests/unit/python/library/test_stack_host_files.py +++ b/tests/unit/python/library/test_stack_host_files.py @@ -116,7 +116,10 @@ class TestApply(unittest.TestCase): wanted = {"de.yaml": "Home: Startseite\n"} _MOD.apply(directory, {}, wanted, ["de.yaml"], [], "0640", "0750") target = directory / "de.yaml" - self.assertEqual(target.read_text(encoding="utf-8"), wanted["de.yaml"]) + produced = target.read_text( + encoding="utf-8" + ) # nocheck: cache-read apply() wrote this file a line above; a cached read would serve the pre-write state + self.assertEqual(produced, wanted["de.yaml"]) self.assertEqual(target.stat().st_mode & 0o777, 0o640) self.assertEqual(directory.stat().st_mode & 0o777, 0o750)