Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@ jobs:
env:
- lint
- format
- example-argparse
- example-click
- example-docopt
- package
- docs
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- name: Install prerequisites
run: python -m pip install tox
- name: Run ${{ matrix.env }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- name: Install prerequisites
run: python -m pip install build twine wheel
- name: Build package
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- macos-latest
- windows-latest
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
Expand Down
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Read the Docs configuration,
# https://docs.readthedocs.io/en/stable/config-file/

version: 2

build:
os: ubuntu-lts-latest
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py
fail_on_warning: true
37 changes: 17 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ cli-test-helpers |latest-version|

Useful helpers for writing tests for your Python CLI program.

Writing tests for a command line interface (CLI) tool `may not seem strictly
straight-forward`_ when you think in terms of unit tests. Especially, when you
use the `argparse`_ module or the `click`_ package, control of the application
entry point is a bit taken away from you.
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 `examples`_ give
you some guidance on how to get started, and the helpers allow you to deal with
common cases, such as mocking CLI arguments and environment variable values.
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
Expand All @@ -35,11 +36,12 @@ common cases, such as mocking CLI arguments and environment variable values.
.. |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
.. _may not seem strictly straight-forward: https://stackoverflow.com/questions/13493288/
.. _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/
.. _examples: https://github.com/painless-software/python-cli-test-helpers/tree/main/examples
.. _CLI Copier template: https://gitlab.com/painless-software/cicd/app/cli

.. links-marker

Expand All @@ -48,11 +50,13 @@ Documentation

See the `documentation`_ for installation instructions and a tutorial.

Examples
--------
Examples / Quickstart
---------------------

The `examples`_ folder contains hands-on example projects you can start to use
directly.
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.

Development
-----------
Expand All @@ -70,10 +74,3 @@ this:
tox -e lint,py312 # run a few environments
tox -e py # run tests with local default Python
tox # run entire suite

The included example projects can be tested independently with their dedicated
environments, e.g.

.. code-block:: shell

tox -e example-docopt
14 changes: 0 additions & 14 deletions copier.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions examples/README.rst

This file was deleted.

14 changes: 0 additions & 14 deletions examples/argparse/.gitignore

This file was deleted.

74 changes: 0 additions & 74 deletions examples/argparse/.gitlab-ci.yml

This file was deleted.

1 change: 0 additions & 1 deletion examples/argparse/LICENSE

This file was deleted.

7 changes: 0 additions & 7 deletions examples/argparse/README.md

This file was deleted.

66 changes: 0 additions & 66 deletions examples/argparse/pyproject.toml

This file was deleted.

Loading
Loading