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:
parent
6c218130e9
commit
6a2d7155cb
2 changed files with 14 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -28,3 +28,4 @@ next_pr.md
|
||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
notes/
|
notes/
|
||||||
|
.coverage
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ dev = [
|
||||||
"aiosqlite>=0.20.0",
|
"aiosqlite>=0.20.0",
|
||||||
"mypy>=1.13.0",
|
"mypy>=1.13.0",
|
||||||
"ruff>=0.14.10",
|
"ruff>=0.14.10",
|
||||||
|
"pytest-cov>=7.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
|
|
@ -55,3 +56,15 @@ quote-style = "double"
|
||||||
[tool.ruff.lint.per-file-ignores]
|
[tool.ruff.lint.per-file-ignores]
|
||||||
"tests/*" = ["E501"] # Allow longer lines in tests for readability
|
"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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue