test_excluded_subtree_is_never_visited

Tests › tests/test_treescan_pruning.py

passed Passed in the packaged run.

What this test is for

Why it exists

The STRUCTURAL half. Equal output sets would also hold for enumerate-then-filter, so membership alone cannot show the walk got smaller; this records every directory the walk actually yielded.

Given

  1. roots, excludes = _make_scan_tree(tmp_path)
  2. visited: list[str] = []
3 more
  1. real_walk = os.walk
  2. def spy(top, **kwargs): for dirpath, dirnames, filenames in real_walk(top, **kwargs): visited.append(dirpath) yield dirpath, dirnames, filenames
  3. monkeypatch.setattr(ts.os, "walk", spy)
→

When

  1. ts.enumerate_tree(roots, excludes, tmp_path)
→

Then

  1. ✓ visited contains str(tmp_path / "src")
  2. ✓ visited does not contain str(tmp_path / "vendored")
  3. ✓ visited does not contain str(tmp_path / "vendored" / "deep")
  4. ✓ visited does not contain str(tmp_path / ".cache")

tests/test_treescan_pruning.py:123 · its file's page

What it checks (4)

  1. assert str(tmp_path / "src") in visited not attributed
  2. assert str(tmp_path / "vendored") not in visited not attributed
  3. assert str(tmp_path / "vendored" / "deep") not in visited not attributed
  4. assert str(tmp_path / ".cache") not in visited not attributed

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_excluded_subtree_is_never_visited→_make_scan_tree→enumerate_tree

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

test_excluded_subtree_is_never_visited · 4 checksenumerate_treeREQ-DDB-INDEX-002 · measuredenumerate_treerel_keyREQ-DDB-PIPE-003 · measured
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.