From f37beb590e5fb9e67315d6525c535374688e9f14 Mon Sep 17 00:00:00 2001 From: zerolab Date: Mon, 15 Apr 2024 16:04:28 +0100 Subject: [PATCH] Move coverage config to .coveragerc fewer bytes in the package --- .coveragerc | 39 +++++++++++++++++++++++++++++++++++++++ pyproject.toml | 40 ---------------------------------------- 2 files changed, 39 insertions(+), 40 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..489a484 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,39 @@ +[run] +branch = True +concurrency = ["multiprocessing", "thread"] +parallel = True + +source = wagtail_footnotes +omit = **/migrations/*,tests/* + +[paths] +source = wagtail_footnotes, .tox/py*/**/site-packages + +[report] +show_missing = True +ignore_errors = True +skip_empty = True +skip_covered = True + +# Regexes for lines to exclude from consideration +exclude_also = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about missing debug-only code: + def __repr__ + if self.debug + if settings.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__.: + + # Nor complain about type checking + "if TYPE_CHECKING:", + class .*\bProtocol\): + @(abc\.)?abstractmethod diff --git a/pyproject.toml b/pyproject.toml index 7635306..bbb18d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,43 +73,3 @@ exclude = [ "ruff.toml", "testmanage.py", ] - - -[tool.coverage.run] -branch = true -concurrency = ["multiprocessing", "thread"] -parallel = true - -source = ["wagtail_footnotes"] -omit = ["**/migrations/*", "tests/*"] - -[tool.coverage.paths] -source = ["wagtail_footnotes", ".tox/py*/**/site-packages"] - -[tool.coverage.report] -show_missing = true -ignore_errors = true -skip_empty = true -skip_covered = true -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__.:", - - # Don't complain about abstract methods, they aren't run: - "@(abc.)?abstractmethod", - - # Nor complain about type checking - "if TYPE_CHECKING:", -]