treeparse

Testing

Utilities for testing treeparse CLIs.

Testing

The library exposes treeparse.testing helpers (captured output, runner, etc.).

from treeparse.testing import run_cli, capture_help

See tests/test_cli_runner.py, test_demo_execution.py, and test_help_snapshots.py for patterns.

Recommended:

  • Use uv run pytest
  • Snapshot-style help tests live in tests/test_help_snapshots.py
  • Always test both success paths and validation errors.

Write a themes page.

On this page