diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index f1f75abbe..000000000 --- a/.coveragerc +++ /dev/null @@ -1,28 +0,0 @@ -# .coveragerc to control coverage.py -[run] -branch = True -source = probnum -# omit = bad_file.py - -[paths] -source = - src/ - */site-packages/ - -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ - if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: diff --git a/pyproject.toml b/pyproject.toml index bc9fca341..cc3db6bb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,6 +118,35 @@ filterwarnings = [ "ignore:the imp module is deprecated in favour of importlib.*:DeprecationWarning:flatbuffers.*" ] +# see https://coverage.readthedocs.io/en/stable/config.html + +[tool.coverage.run] +branch = true +source = [ + "probnum", +] + +[tool.coverage.paths] +source = [ + "src/", + "*/site-packages/", +] + +[tool.coverage.report] +exclude_lines = [ + # Have to re-enable the standard pragma + 'pragma: no cover', + # Don't complain about missing debug-only code: + 'def __repr__(self):', + 'if self\.debug', + # Don't complain if tests don't hit defensive assertion code: + 'raise AssertionError', + 'raise NotImplementedError', + # Don't complain if non-runnable code isn't run: + 'if 0:', + 'if __name__ == .__main__.:', +] + ################################################################################ # Linting Configuration # ################################################################################