You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Coverage >5.0a6 seems to fail to generate a report when coverage is 0%, when run by pytest-cov under tox.
To Reproduce
Please see https://github.com/wlcx/coverage-bug-repro for a minimum working reproduction of this. Essentially, it is a single module project, with a test that doesn't actually result in any code coverage. I appreciate this is a bit of a useless edge case, but this did used to not cause any errors!
Run tox (which runs python -m pytest --cov=foo tests/):
PS C:\Users\sam.willcocks\prog\coverage-bug-repro> tox
py3 recreate: C:\Users\sam.willcocks\prog\coverage-bug-repro\.tox\py3
py3 installdeps: py, pytest, pytest-cov, coverage
py3 installed: atomicwrites==1.3.0,attrs==19.3.0,colorama==0.4.3,coverage==5.0,importlib-metadata==1.3.0,more-itertools==8.0.2,packaging==19.2,pluggy==0.13.1,py==1.8.0,pyparsing==2.4.5,pytest==5.3.2,pytest-cov==2.8.1,six==1.13.0,wcwidth==0.1.7,zipp==0.6.0
py3 run-test-pre: PYTHONHASHSEED='286'
py3 run-test: commands[0] | python -m pytest --cov=foo tests/
=========================================================== test session starts ============================================================
platform win32 -- Python 3.7.4, pytest-5.3.2, py-1.8.0, pluggy-0.13.1
cachedir: .tox\py3\.pytest_cache
rootdir: C:\Users\sam.willcocks\prog\coverage-bug-repro
plugins: cov-2.8.1
collected 1 item
tests\test_nothing.py . [100%]Coverage.py warning: No data was collected. (no-data-collected)
WARNING: Failed to generate report: No data to report.
C:\Users\sam.willcocks\prog\coverage-bug-repro\.tox\py3\lib\site-packages\pytest_cov\plugin.py:254: PytestWarning: Failed to generate report: No data to report.
self.cov_controller.finish()
----------- coverage: platform win32, python 3.7.4-final-0 -----------
============================================================ 1 passed in 0.07s =============================================================
_________________________________________________________________ summary __________________________________________________________________
py3: commands succeeded
congratulations :)
Describe the bug
Coverage >5.0a6 seems to fail to generate a report when coverage is 0%, when run by pytest-cov under tox.
To Reproduce
Please see https://github.com/wlcx/coverage-bug-repro for a minimum working reproduction of this. Essentially, it is a single module project, with a test that doesn't actually result in any code coverage. I appreciate this is a bit of a useless edge case, but this did used to not cause any errors!
tox
(which runspython -m pytest --cov=foo tests/
):tox -e coverage-report
(running coverage html):Expected behavior
If I pin the version of coverage used to
==5.0a5
:coverage html
:The text was updated successfully, but these errors were encountered: