Hi,
I am working on a project called NiQuery hosted on GitHub. I am confused about the coverage report.
I was surprised to see that the module run.py had 0% coverage.
I thought that this may be related to the use of click commands by the run.py module, and some sort of interaction that I was missing between components, or the way things are imported. However, I have realized that there are such as filtering.py and featuring.py that do not depend on click for which the reported coverage is also 0%. Again, they are extensively tested.
In the relevant command in my tox.ini file, if I change the package name for the location of the files for the cov option:
commands =
pytest -sv --doctest-modules --cov niquery --cov-report xml \
--junitxml=test-results.xml -v src test {posargs:-n auto}
to
commands =
pytest -sv --doctest-modules --cov src/niquery --cov-report xml \
--junitxml=test-results.xml -v src test {posargs:-n auto}
then the coverage increases significantly (from 0% to 82%, 98% and 100%)
It can also be reproduced simply calling pytest:
pytest --cov niquery
vs
pytest --cov src/niquery
I contribute to other projects that have a very similar structure and use the package name for the cov option and do not have this issues.
I would like to stick to the philosophy of using the package name for the cov option, unless this is wrong, as it is used by other projects within the organization.
I am wondering what am I doing wrong here.
Thank you.