I’m trying to declare the proper coverage
bits in a tox.ini
file. Nothing breaks, but the coverage is always zero. I was working with the example in this file and came up with tox.ini
:
[tox]
envlist = py{37,38,39,310,311,312,313},report
minversion = 3.3.0
isolated_build = true
[testenv]
deps =
check-manifest >= 0.42
pytest
pytest-cov
commands =
check-manifest --ignore 'tox.ini,tests/**,.editorconfig,vscode.env,.vscode/**'
python setup.py check -m -s
pytest tests {posargs}
depends =
report: py{37,38,39,310,311,312,313}
[testenv:report]
deps = coverage
skip_install = true
commands =
coverage report
coverage html
The few tests which exist pass (strongly suggesting some lines were executed), but the coverage report shows no coverage:
report: install_deps> python -I -m pip install coverage
report: commands[0]> coverage report
Name Stmts Miss Cover
----------------------------------------------
src/heic2png/__init__.py 1 1 0%
src/heic2png/cli.py 55 55 0%
src/heic2png/heic2png.py 28 28 0%
----------------------------------------------
TOTAL 84 84 0%
report: commands[1]> coverage html
Wrote HTML report to htmlcov/index.html
I’m not really a tox
user, so most of what is in the config file is just Greek to me. I’m just copy/pasting bits then tweaking as seems correct. Any help appreciated…