diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ba6a2c5..c3a170c 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -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: >
diff --git a/coverage.svg b/coverage.svg
index ef52bd2..7175bd1 100644
--- a/coverage.svg
+++ b/coverage.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 6905e33..2bc2520 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -20,6 +20,7 @@ dev = [
"pre-commit>=4.5.1",
]
test = [
+ "covdefaults>=2.3.0",
"pytest>=9.0.3",
"pytest-cov>=7.0.0",
]
@@ -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