Skip to content

Commit d89c8e6

Browse files
committed
coverage config: Add some excludes
This makes the results more useful Signed-off-by: Jussi Kukkonen <[email protected]>
1 parent fca3086 commit d89c8e6

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,13 @@ module = [
149149
"securesystemslib.*",
150150
]
151151
ignore_missing_imports = "True"
152+
153+
[tool.coverage.report]
154+
exclude_also = [
155+
# abstract class method definition
156+
"raise NotImplementedError",
157+
# defensive programming: these cannot happen
158+
"raise AssertionError",
159+
# imports for mypy only
160+
"if TYPE_CHECKING",
161+
]

requirements/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
-r pinned.txt
55

66
# coverage measurement
7-
coverage==7.6.8
7+
coverage[toml]==7.6.8
88
freezegun==1.5.1

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ changedir = tests
1717
commands =
1818
python3 --version
1919
python3 -m coverage run aggregate_tests.py
20-
python3 -m coverage report -m --fail-under 97
20+
python3 -m coverage report --rcfile {toxinidir}/pyproject.toml -m --fail-under 97
2121

2222
deps =
2323
-r{toxinidir}/requirements/test.txt
@@ -38,7 +38,7 @@ commands_pre =
3838

3939
commands =
4040
python3 -m coverage run aggregate_tests.py
41-
python3 -m coverage report -m
41+
python3 -m coverage report --rcfile {toxinidir}/pyproject.toml -m
4242

4343
[testenv:lint]
4444
changedir = {toxinidir}

0 commit comments

Comments
 (0)