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
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ repos:
language: unsupported
pass_filenames: false
always_run: true
# https://youtu.be/70T6OxKwxm0
- id: test-coverage
name: Tests have 100% run coverage
entry: >
coverage report
--no-skip-covered
--include 'tests/*'
--fail-under 100
stages: ["pre-push"]
language: unsupported
pass_filenames: false
always_run: true
- id: coverage-badge
name: Generate coverage badge
entry: >
Expand Down
2 changes: 1 addition & 1 deletion coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dev = [
"pre-commit>=4.5.1",
]
test = [
"covdefaults>=2.3.0",
"pytest>=9.0.3",
"pytest-cov>=7.0.0",
]
Expand Down Expand Up @@ -73,11 +74,12 @@ shell = """


[tool.pytest.ini_options]
addopts = "--cov=src"
addopts = "--cov"
testpaths = ["tests"]

[tool.coverage]
run.branch = true
run.plugins = ["covdefaults"] # https://youtu.be/70T6OxKwxm0
report.fail_under = 80
report.show_missing = true

Expand Down