Skip to content

Commit c08cafb

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 c08cafb

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
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+
]

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)