
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
|check-status| |test-status| |publish-status| |python-support| |license| |docs-status|
Useful helpers for writing tests for your Python CLI program.
Writing tests for a command line interface (CLI) application is more difficult than it seems at first sight
. Especially, when you use the argparse
module
or the docopt
_ or click
_ package, control of the application entry point is
a bit taken away from you.
But it's not all that bad. This package is here to help. The Painless Software
CLI Copier template
_ offers some guidance on how to get started, and the
CLI test helpers allow you to deal with common cases, such as mocking CLI
arguments and environment variable values.
.. |latest-version| image:: https://img.shields.io/pypi/v/cli-test-helpers.svg :target: https://pypi.org/project/cli-test-helpers :alt: Latest version on PyPI .. |check-status| image:: https://github.com/painless-software/python-cli-test-helpers/actions/workflows/check.yml/badge.svg :target: https://github.com/painless-software/python-cli-test-helpers/actions/workflows/check.yml :alt: Code checks status .. |test-status| image:: https://github.com/painless-software/python-cli-test-helpers/actions/workflows/test.yml/badge.svg :target: https://github.com/painless-software/python-cli-test-helpers/actions/workflows/test.yml :alt: Test suite status .. |publish-status| image:: https://github.com/painless-software/python-cli-test-helpers/actions/workflows/publish.yml/badge.svg :target: https://github.com/painless-software/python-cli-test-helpers/actions/workflows/publish.yml :alt: Latest release Status .. |python-support| image:: https://img.shields.io/pypi/pyversions/cli-test-helpers.svg :target: https://pypi.org/project/cli-test-helpers :alt: Python versions .. |license| image:: https://img.shields.io/pypi/l/cli-test-helpers.svg :target: https://github.com/painless-software/python-cli-test-helpers/blob/main/LICENSE :alt: Software license .. |docs-status| image:: https://img.shields.io/readthedocs/python-cli-test-helpers/latest.svg :target: https://readthedocs.org/projects/python-cli-test-helpers/ :alt: Documentation Status .. _more difficult than it seems at first sight: https://stackoverflow.com/questions/13493288/ .. _argparse: https://docs.python.org/3/library/argparse.html .. _click: https://click.palletsprojects.com/ .. _docopt: http://docopt.org/ .. _documentation: https://python-cli-test-helpers.readthedocs.io/ .. _CLI Copier template: https://gitlab.com/painless-software/cicd/app/cli .. _CONTRIBUTING: https://github.com/painless-software/python-cli-test-helpers/blob/main/CONTRIBUTING.rst
.. links-marker
See the documentation
_ for installation instructions and a tutorial.
Visit the Painless Software CLI Copier template
_ to inspect hands-on CLI
application blueprints for the most popular CLI frameworks. The Copier tool
lets you create your own CLI application project with tests and modern CI/CD,
effortlessly.
See CONTRIBUTING
_.
FAQs
Useful helpers for writing tests for your Python CLI program.
We found that cli-test-helpers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.