From 5bb49ebae02bd74f67ebc6368f6702134d243d47 Mon Sep 17 00:00:00 2001 From: scarreras Date: Fri, 2 Oct 2026 19:51:58 -0300 Subject: [PATCH] test(sdkharness): leaf-check unit tests skip __pycache__ and other non-leaf entries Co-Authored-By: Claude Sonnet 5.5 --- .../+sdkharness-leaves-skip-pycache.infrastructure.md | 1 + .../test_sdkharness_conformance_resilience_contract.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog.d/+sdkharness-leaves-skip-pycache.infrastructure.md diff --git a/changelog.d/+sdkharness-leaves-skip-pycache.infrastructure.md b/changelog.d/+sdkharness-leaves-skip-pycache.infrastructure.md new file mode 100644 index 00000000..4d74b425 --- /dev/null +++ b/changelog.d/+sdkharness-leaves-skip-pycache.infrastructure.md @@ -0,0 +1 @@ +Make the sdkharness leaf-check unit tests ignore `__pycache__` and other non-leaf entries. diff --git a/test/unit/test_sdkharness_conformance_resilience_contract.py b/test/unit/test_sdkharness_conformance_resilience_contract.py index e133e44f..15d59f77 100644 --- a/test/unit/test_sdkharness_conformance_resilience_contract.py +++ b/test/unit/test_sdkharness_conformance_resilience_contract.py @@ -110,10 +110,18 @@ def test_child_environment_scrubs_real_b2_credentials_and_pins_checkout(): LEAF_ROOT = Path(__file__).parents[2] / '.sdkharness' / 'tests' LEAVES = sorted( - path for level in ('conformance', 'resilience') for path in (LEAF_ROOT / level).iterdir() + path + for level in ('conformance', 'resilience') + for path in (LEAF_ROOT / level).iterdir() + if path.is_file() and not path.name.startswith(('__', '.')) ) +def test_leaves_are_regular_files_only(): + assert LEAVES + assert all(path.is_file() and not path.name.startswith('__') for path in LEAVES) + + def run_leaf(path, extra_environment): import os import subprocess