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