Lots of red text when running `tox` on a fresh cookie.

Aperta
#560 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@samcunliffe ci sta già lavorando.

Dal 15/7/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug
Describe the Bug

During the workshop we ran tox on a demo package. There were a lot of errors possibly related to coverage?

To Reproduce

Cookiecut a fresh cookie.

uv venv
source .venv/bin/activate
uv pip install -e ".[dev,test]"
which tox
tox
Expected Behaviour

tox should run tests in all supported Python versions with nice comforting green text. And no red text.

Actual Behaviour
/Users/scnlf/projects/example-cookie/.tox/py311/lib/python3.11/site-packages/coverage/inorout.py:509: CoverageWarning: Module example-cookie was never imported. (module-not-imported)
  self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
/Users/scnlf/projects/example-cookie/.tox/py311/lib/python3.11/site-packages/coverage/control.py:915: CoverageWarning: No data was collected. (no-data-collected)
  self._warn("No data was collected.", slug="no-data-collected")
tests/test_dummy.py::test_stupid_example PASSED                                                                            [100%]
WARNING: Failed to generate report: No data to report.

/Users/scnlf/projects/example-cookie/.tox/py311/lib/python3.11/site-packages/pytest_cov/plugin.py:358: CovReportWarning: Failed to generate report: No data to report.

  warnings.warn(CovReportWarning(message), stacklevel=1)


========================================================= tests coverage =========================================================
_______________________________________ coverage: platform darwin, python 3.11.12-final-0 ________________________________________

======================================================= 1 passed in 0.02s ========================================================
py311: OK ✔ in 9.54 seconds
py312: install_package_deps> python -I -m pip install pytest pytest-cov
py312: install_package> python -I -m pip install --force-reinstall --no-deps /Users/scnlf/projects/example-cookie/.tox/.tmp/package/4/example-cookie-0.1.dev0.tar.gz
py312: commands[0]> pytest --cov --cov-report=xml
Version In Use

Current latest tag.

Additional Context
- Cookiecutter version:
- Operating system: macOS
- Python version: all!
Lingua principale
Python
Stelle
62
Fork
10
Merge medio
7g 6h
PR unite (30g)
6

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di UCL-ARC/python-tooling

Tutte le issue di UCL-ARC/python-tooling

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.