Add more specific coverage configuration

pyproject.toml:
Set specific source for `toolscoverage.paths` (as we only provide one
module).
Set `tools.coverage.run.relative_files` to true (although it is still
bug riddled and does not seem to work as advertized in regards to xml
output: https://github.com/nedbat/coveragepy/issues/963,
https://github.com/nedbat/coveragepy/issues/1147).
Set `tool.coverage.xml.output`, so we don't have to provide it on the
commandline.

Makefile:
Do not provide an output file to the coverage xml call, as we do that in
configuration now.
This commit is contained in:
David Runge 2021-11-01 22:25:11 +01:00 committed by Levente Polyak
parent 86eb172ac3
commit a25c267f26
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8
2 changed files with 7 additions and 3 deletions

View File

@ -17,7 +17,7 @@ fmt:
test: test:
coverage run coverage run
coverage report coverage report
coverage xml -o build/coverage.xml coverage xml
build: build:
./keyringctl -v build ./keyringctl -v build

View File

@ -17,8 +17,8 @@ exclude = '''
)/ )/
''' '''
[tool.coverage.path] [tool.coverage.paths]
source = "." source = ["libkeyringctl"]
[tool.coverage.report] [tool.coverage.report]
omit = ["tests/*", ".tox/*"] omit = ["tests/*", ".tox/*"]
@ -29,6 +29,10 @@ show_missing = true
branch = true branch = true
command_line = "-m pytest --junit-xml=build/junit-report.xml -vv tests/" command_line = "-m pytest --junit-xml=build/junit-report.xml -vv tests/"
omit = ["tests/*", ".tox/*"] omit = ["tests/*", ".tox/*"]
relative_files = true
[tool.coverage.xml]
output = "build/coverage.xml"
[tool.isort] [tool.isort]
profile = "black" profile = "black"