Python test coverage
SonarQube supports the reporting of test coverage information as part of the analysis of your Python project.
Adjust your setup
Add coverage to your build process
[tox]
envlist = py39
skipsdist = True
[testenv]
deps =
pytest
coverage
commands =
coverage run -m pytest
coverage xml
[coverage:run]
relative_files = True
source = my_project/
branch = TrueAdd the coverage analysis parameter
Coverage parameters can be set in multiple places
Related pages
Last updated
Was this helpful?

