Skip to content

Commit

Permalink
Adjust coverage scope and add no argument test case (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeacom authored Jul 9, 2023
1 parent d9cb585 commit 87f2046
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# python-template

[![Validation Workflow](https://github.com/mbeacom/python-template/actions/workflows/validate.yaml/badge.svg?branch=main&event=push)](https://github.com/mbeacom/python-template/actions/workflows/validate.yaml)
[![Pre-Commit Checks Workflow](https://github.com/mbeacom/python-template/actions/workflows/pre-commit.yaml/badge.svg?branch=main&event=push)](https://github.com/mbeacom/python-template/actions/workflows/pre-commit.yaml)
[![Coverage Status](https://codecov.io/github/mbeacom/python-template/coverage.svg?branch=main)](https://codecov.io/github/mbeacom/python-template?branch=main)
[![PyPi](https://img.shields.io/pypi/v/python-template-x)](https://pypi.org/project/python-template-x/)

This project is an opinionated python template.

## Usage
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ target-version = "py311"
"FBT", # Ignore booleans as positional arguments in tests, e.g., @pytest.mark.parametrize()
]

[tool.coverage.run]
omit = [
"*/tests/*",
"*/__init__.py",
"*/__main__.py",
]

[tool.poe.tasks]
isort = "isort --profile=black ."
black = "black ."
Expand Down
12 changes: 9 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@


def test_entry_version_arg() -> None:
"""Test the entry method with version argument."""
"""Test the entry method with the version argument."""
result = runner.invoke(app, ["--version"])
assert result.exit_code == 0
assert "python-template version" in result.stdout


def test_entry_no_arg() -> None:
"""Test the entry method with no arguments."""
def test_entry_help() -> None:
"""Test the entry method with the help argument."""
result = runner.invoke(app, ["--help"])
assert result.exit_code == 0
assert "OPTIONS" in result.stdout


def test_entry_no_arg() -> None:
"""Test the entry method with no arguments."""
result = runner.invoke(app, [])
assert result.exit_code == 0

0 comments on commit 87f2046

Please sign in to comment.