Skip to content

Commit a25c267

Browse files
dvzrvanthraxx
authored andcommitted
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: nedbat/coveragepy#963, nedbat/coveragepy#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.
1 parent 86eb172 commit a25c267

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fmt:
1717
test:
1818
coverage run
1919
coverage report
20-
coverage xml -o build/coverage.xml
20+
coverage xml
2121

2222
build:
2323
./keyringctl -v build

pyproject.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ exclude = '''
1717
)/
1818
'''
1919

20-
[tool.coverage.path]
21-
source = "."
20+
[tool.coverage.paths]
21+
source = ["libkeyringctl"]
2222

2323
[tool.coverage.report]
2424
omit = ["tests/*", ".tox/*"]
@@ -29,6 +29,10 @@ show_missing = true
2929
branch = true
3030
command_line = "-m pytest --junit-xml=build/junit-report.xml -vv tests/"
3131
omit = ["tests/*", ".tox/*"]
32+
relative_files = true
33+
34+
[tool.coverage.xml]
35+
output = "build/coverage.xml"
3236

3337
[tool.isort]
3438
profile = "black"

0 commit comments

Comments
 (0)