python-cli-testing
OfficialTest Typer/Click CLIs with CliRunner.
Authordatabio
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Automates and standardizes testing of Typer/Click-based Python CLIs using CliRunner, reducing flaky tests and improving reliability.
Core Features & Use Cases
- CliRunner-based isolation: Tests execute CLI commands without spawning subprocesses, capturing stdout and stderr.
- Fixtures and test structure: Provides conftest.py fixtures for reusable test setup.
- Comprehensive coverage: Tests exit codes, stdout/stderr capture, interactive prompts, and isolated filesystem scenarios.
- Practical examples: Guides how to structure tests for common Typer/Click patterns and real-world CLI workflows.
Quick Start
Run pytest in your Typer project to start writing CliRunner-based tests for your CLI.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: python-cli-testing Download link: https://github.com/databio/ai-sandbox/archive/main.zip#python-cli-testing Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.