Skip to content

Commit 7a56af8

Browse files
committed
fix(tests): skip tree-format test when tree is not a subprocess on Windows
On Windows, `tree` is a cmd.exe built-in, not a standalone executable, so subprocess.run raises FileNotFoundError instead of returning non-zero.
1 parent 1a9931e commit 7a56af8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/test_cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,10 @@ def test_paths_from_tree_format(tmp_path: Path, sample_tree: Path) -> None:
449449
import subprocess
450450

451451
# Generate real tree output from sample_tree
452-
tree_result = subprocess.run(["tree", str(sample_tree)], capture_output=True, text=True)
452+
try:
453+
tree_result = subprocess.run(["tree", str(sample_tree)], capture_output=True, text=True)
454+
except FileNotFoundError:
455+
pytest.skip("tree command not available")
453456
if tree_result.returncode != 0:
454457
pytest.skip("tree command not available")
455458

0 commit comments

Comments
 (0)