diff --git a/pyproject.toml b/pyproject.toml index e7e1fc46..fbaf4863 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -149,3 +149,13 @@ module = [ "securesystemslib.*", ] ignore_missing_imports = "True" + +[tool.coverage.report] +exclude_also = [ + # abstract class method definition + "raise NotImplementedError", + # defensive programming: these cannot happen + "raise AssertionError", + # imports for mypy only + "if TYPE_CHECKING", +] \ No newline at end of file diff --git a/requirements/test.txt b/requirements/test.txt index 66856203..69df3345 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,5 +4,5 @@ -r pinned.txt # coverage measurement -coverage==7.6.8 +coverage[toml]==7.6.8 freezegun==1.5.1 diff --git a/tox.ini b/tox.ini index 9d467974..03dd2324 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ changedir = tests commands = python3 --version python3 -m coverage run aggregate_tests.py - python3 -m coverage report -m --fail-under 97 + python3 -m coverage report --rcfile {toxinidir}/pyproject.toml -m --fail-under 97 deps = -r{toxinidir}/requirements/test.txt @@ -38,7 +38,7 @@ commands_pre = commands = python3 -m coverage run aggregate_tests.py - python3 -m coverage report -m + python3 -m coverage report --rcfile {toxinidir}/pyproject.toml -m [testenv:lint] changedir = {toxinidir}