At the moment coverage is always active in pytest. It is disabled in vscode debugging with a launch config. Some projects don't want to store .vscode in repo, so delete it, but then when they point vscode to it without any settings they have something where debugging doesn't work. It would seem better to have debugging work but coverage not active.
Then we need to test that coverage work in vscode and the commandline, that debugging works in vscode out of the box and when the .vscode directory is deleted, and that CI still sends coverage to codecov
At the moment coverage is always active in pytest. It is disabled in vscode debugging with a launch config. Some projects don't want to store .vscode in repo, so delete it, but then when they point vscode to it without any settings they have something where debugging doesn't work. It would seem better to have debugging work but coverage not active.
To change this we should delete: https://github.com/DiamondLightSource/python3-pip-skeleton/blob/64d2a03ba80d52b6d22ca541bb32eb6b455d83f9/pyproject.toml#L78
And then add
--cov=python3_pip_skeleton --cov-report term --cov-report xml:cov.xml
here: https://github.com/DiamondLightSource/python3-pip-skeleton/blob/64d2a03ba80d52b6d22ca541bb32eb6b455d83f9/pyproject.toml#L110 This means thattox -e pytest
will do terminal and xml reported coverageAlso set
here: https://github.com/DiamondLightSource/python3-pip-skeleton/blob/64d2a03ba80d52b6d22ca541bb32eb6b455d83f9/.vscode/settings.json#L6 This means that vscode testing will write the coverage to an xml file that coverage gutters can use.
Finally we need to tell CI to also do this by doing
tox -e pytest
instead of: https://github.com/DiamondLightSource/python3-pip-skeleton/blob/64d2a03ba80d52b6d22ca541bb32eb6b455d83f9/.github/workflows/code.yml#L66Then we need to test that coverage work in vscode and the commandline, that debugging works in vscode out of the box and when the .vscode directory is deleted, and that CI still sends coverage to codecov