Add pytest-cov for test coverage

- Add pytest-cov as dev dependency
- Configure coverage in pyproject.toml
- Exclude tests, __pycache__, seed.py from coverage
- Enable branch coverage
- Add .coverage to gitignore
This commit is contained in:
counterweight 2025-12-21 21:55:04 +01:00
parent 6c218130e9
commit 6a2d7155cb
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 14 additions and 0 deletions

View file

@ -21,6 +21,7 @@ dev = [
"aiosqlite>=0.20.0",
"mypy>=1.13.0",
"ruff>=0.14.10",
"pytest-cov>=7.0.0",
]
[tool.mypy]
@ -55,3 +56,15 @@ quote-style = "double"
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["E501"] # Allow longer lines in tests for readability
[tool.coverage.run]
source = ["."]
omit = ["tests/*", "__pycache__/*", "seed.py"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
]
show_missing = true