From 2534af1a9941c0ad755675a5c133e79d3bfcbe0f Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sun, 27 Sep 2026 17:21:02 +0200 Subject: [PATCH] fix(dev): make the pre-flight dedup test independent of glob order test_identical_text_inside_generated_regions_is_invisible took the first SKILL.md from an unsorted glob and asserted it carries the auto pre-flight block. The setup skills carry none, so the test passed or failed depending on filesystem order. It now picks the first carrier in sorted order. Generated-by: Claude Code (Opus 5.5) --- tools/dev/tests/test_check_duplication.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/dev/tests/test_check_duplication.py b/tools/dev/tests/test_check_duplication.py index ac318214e..696348b87 100644 --- a/tools/dev/tests/test_check_duplication.py +++ b/tools/dev/tests/test_check_duplication.py @@ -104,10 +104,11 @@ def test_identical_text_inside_generated_regions_is_invisible() -> None: `strip_generated_regions` exists. Reuses a real propagated block from the live tree so the test tracks the real marker text, not a hand-written stand-in.""" - live_skill = next((REPO / "skills").glob("*/SKILL.md")) - text = live_skill.read_text() - match = MOD.PREFLIGHT_RE.search(text) - assert match, "expected the live skill to carry the auto pre-flight block" + # Not every skill carries the block (the setup skills do not), and glob + # order is filesystem-dependent, so pick the first carrier in sorted order. + matches = (MOD.PREFLIGHT_RE.search(p.read_text()) for p in sorted((REPO / "skills").glob("*/SKILL.md"))) + match = next((m for m in matches if m), None) + assert match, "expected at least one live skill to carry the auto pre-flight block" block = match.group(0) paragraphs = MOD.extract_paragraphs(