Skip to content

Commit 87f2046

Browse files
authored
Adjust coverage scope and add no argument test case (#10)
1 parent d9cb585 commit 87f2046

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# python-template
22

3+
[![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)
4+
[![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)
5+
[![Coverage Status](https://codecov.io/github/mbeacom/python-template/coverage.svg?branch=main)](https://codecov.io/github/mbeacom/python-template?branch=main)
6+
[![PyPi](https://img.shields.io/pypi/v/python-template-x)](https://pypi.org/project/python-template-x/)
7+
38
This project is an opinionated python template.
49

510
## Usage

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ target-version = "py311"
128128
"FBT", # Ignore booleans as positional arguments in tests, e.g., @pytest.mark.parametrize()
129129
]
130130

131+
[tool.coverage.run]
132+
omit = [
133+
"*/tests/*",
134+
"*/__init__.py",
135+
"*/__main__.py",
136+
]
137+
131138
[tool.poe.tasks]
132139
isort = "isort --profile=black ."
133140
black = "black ."

tests/test_cli.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
99

1010

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

1717

18-
def test_entry_no_arg() -> None:
19-
"""Test the entry method with no arguments."""
18+
def test_entry_help() -> None:
19+
"""Test the entry method with the help argument."""
2020
result = runner.invoke(app, ["--help"])
2121
assert result.exit_code == 0
2222
assert "OPTIONS" in result.stdout
23+
24+
25+
def test_entry_no_arg() -> None:
26+
"""Test the entry method with no arguments."""
27+
result = runner.invoke(app, [])
28+
assert result.exit_code == 0

0 commit comments

Comments
 (0)