Skip to content

Commit

Permalink
Merge pull request #8 from nathandines/add-code-coverage
Browse files Browse the repository at this point in the history
Add Code Coverage
  • Loading branch information
nathandines authored Jan 27, 2024
2 parents 6422843 + b3f7de7 commit 2bab1fb
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
needs: [python-deps]
uses: nathandines/calibre-template-functions/.github/workflows/run_in_pyenv.yml@main
with:
run_command: poetry run pytest -v
run_command: poetry run pytest -v --cov=. .
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.venv
**/__pycache__
.vscode

.coverage
87 changes: 86 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ python = "^3.8"
pytest = "^7.4.4"
ruff = "^0.1.13"
mypy = "^1.8.0"
pytest-cov = "^4.1.0"

[tool.ruff]
extend-select = ["I"]
Expand All @@ -21,6 +22,14 @@ strict = true
warn_redundant_casts = true
warn_unused_ignores = true

[tool.coverage.run]
branch = true

[tool.coverage.report]
exclude_also = ["^\\s*\\.{3}$"]
fail_under = 100.0
show_missing = true

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion tests/stubs/calibre.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def field_for(
)
if return_val:
return return_val
return default_return
return default_return # pragma: no cover


@dataclass
Expand Down

0 comments on commit 2bab1fb

Please sign in to comment.