pyproject: write XML coverage after running the testsuite.

This is particularly useful with IDEs that can display coverage in
the editor, e.g. VS Code with the "Coverage Gutters" extension.
This commit is contained in:
Catherine 2024-05-06 10:49:38 +00:00
parent 25c3531e93
commit eef248a080
3 changed files with 4 additions and 2 deletions

View file

@ -7,6 +7,6 @@ omit =
[report]
exclude_lines =
:nocov:
:nocov:
partial_branches =
:nobr:

1
.gitignore vendored
View file

@ -12,6 +12,7 @@ __pycache__/
# coverage
/.coverage
/htmlcov
/coverage.xml
# tests
/tests/spec_*/

View file

@ -83,7 +83,7 @@ examples = [
[tool.pdm.scripts]
_.env_file = ".env.toolchain"
test.composite = ["test-code", "test-docs"]
test.composite = ["test-code", "test-docs", "coverage-xml"]
test-code.env = {PYTHONWARNINGS = "error"}
test-code.cmd = "python -m coverage run -m unittest discover -t . -s tests -v"
test-docs.cmd = "sphinx-build -b doctest docs/ docs/_build"
@ -94,3 +94,4 @@ document-linkcheck.cmd = "sphinx-build docs/ docs/_linkcheck/ -b linkcheck"
coverage-text.cmd = "python -m coverage report"
coverage-html.cmd = "python -m coverage html"
coverage-xml.cmd = "python -m coverage xml"