Reporting cumulative coverage across multiple Python versions

筅森魡賤 提交于 2019-12-09 15:54:09

问题


I have code that runs conditionally depending on the current version of Python, because I'm supporting 2.6, 2.7, and 3.3 from the same package.

I currently generate a coverage report like this, using the default version of Python:

coverage run --source mypackage setup.py test
coverage report -m
coverage html

This is useful but not ideal, as it only reports coverage on Python 2.7. Instead, I would like to generate a cumulative report of the test coverage across 2.6, 2.7, and 3.2.

How do I generate a multi-version coverage report?

Side note: I've tried putting commands = coverage run --source mypackage setup.py test into my tox.ini for each of py26, py27, py33, but that doesn't seem to generate a cumulative coverage report.


回答1:


http://nedbatchelder.com/code/coverage/cmd.html#cmd-combining is of use according to the developer.



来源:https://stackoverflow.com/questions/18418862/reporting-cumulative-coverage-across-multiple-python-versions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!