Skip to content

Commit 2694ecd

Browse files
committed
chore: set up Coverage.py via pytest-cov plugin
1 parent 144e217 commit 2694ecd

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
__pycache__/
2+
.coverage
3+
.htmlcov/
24
.mypy_cache/
35
.nox/
46
.pytest_cache/
57
.ruff_cache/
68
*.egg-info/
79
build/
10+
coverage.xml
811
dist/
912
node_modules/

pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ dev = [
4646
"nox == 2024.4.15",
4747
"pre-commit ~= 3.8",
4848
"pytest ~= 8.3",
49+
"pytest-cov ~= 5.0",
4950
"pytest-custom-exit-code ~= 0.3",
5051
"pytest-django ~= 4.9",
5152
"pytest-mock ~= 3.14",
@@ -118,6 +119,25 @@ addopts = [
118119
"-ra",
119120
"--suppress-no-test-exit-code",
120121
"--ds=tests.settings",
122+
"--cov",
123+
"--cov-append",
124+
"--cov-branch",
125+
"--cov-report=term-missing:skip-covered",
126+
"--cov-report=xml",
121127
]
122128
pythonpath = [".", "src/"]
123129
testpaths = ["tests/"]
130+
131+
[tool.coverage.run]
132+
source = ["src/"]
133+
134+
[tool.coverage.report]
135+
exclude_also = [
136+
"if TYPE_CHECKING:",
137+
]
138+
139+
[tool.coverage.html]
140+
directory = ".htmlcov/"
141+
142+
[tool.coverage.xml]
143+
output = "coverage.xml"

0 commit comments

Comments
 (0)