Skip to content

Commit

Permalink
Move coverage config to .coveragerc
Browse files Browse the repository at this point in the history
fewer bytes in the package
  • Loading branch information
zerolab committed Apr 15, 2024
1 parent bc3f81c commit 23cf28f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 40 deletions.
39 changes: 39 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -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
40 changes: 0 additions & 40 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
]

0 comments on commit 23cf28f

Please sign in to comment.