DiamondLightSource / python3-pip-skeleton

Archived in favour of https://github.com/DiamondLightSource/python-copier-template
Apache License 2.0
4 stars 4 forks source link

Cannot generate coverage report. #145

Closed JoshuaAppleby closed 1 year ago

JoshuaAppleby commented 1 year ago

Running tox -e pytest returns this:

venv/lib/python3.10/site-packages/coverage/inorout.py:507: CoverageWarning: Module python3_pip_skeleton was never imported. (module-not-imported)
  self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
/venv/lib/python3.10/site-packages/coverage/control.py:883: CoverageWarning: No data was collected. (no-data-collected)
  self._warn("No data was collected.", slug="no-data-collected")
WARNING: Failed to generate report: No data to report.

/venv/lib/python3.10/site-packages/pytest_cov/plugin.py:312: CovReportWarning: Failed to generate report: No data to report.

  warnings.warn(CovReportWarning(message))

---------- coverage: platform linux, python 3.10.12-final-0 ----------

====================================================================================== 85 passed in 51.20s ======================================================================================

This is after updating my repo from d5ab1fb0a00b5dafc318eca86bdf27894bcfd87a to 3415f1c8b7c9305600d06a6be460cab081556950

Additionally, running pytest --cov-report term-missing now does not show the coverage table or the missing lines.

JoshuaAppleby commented 1 year ago

Line 109 in pyproject.toml of c68c75e2fa2578d2f2609abaf20a09b19b1be03e requires a name change from --cov=python3_pip_skeleton to --cov="name of your repo", which wasnt explicity stated. Additionally, if missing lines are wanted then change --cov-report term to --cov-report term-missing.

gilesknap commented 1 year ago

@JoshuaAppleby its not stated because it would normally get done for you when you adopt skeleton.

But updating to a more recent skeleton via merge is what caused your issue. It would have been a merge conflict resolution mistake which is really easy to do unfortunately - I don't know of a good way to make this any easier.

gilesknap commented 1 year ago

We should probably suggest a global search for python3_pip_skeleton after doing a merge or maybe we should recommend -readoption?