How to output coverage XML with nosetests?

北战南征 提交于 2019-12-12 09:32:36

问题


I'm trying to output the coverage XML of my nosetests so they show up on Hudson. The line I'm executing is:

nosetests --with-gae -v --all-modules --with-xunit --with-coverage

I see the coverage output in the console, but there's no xml file containing the coverage data. How can I get it to output the coverage xml?


回答1:


Once you've run the nosetests command, there will be a .coverage data file in the directory. If you then run coverage xml, it will create a Cobertura-compatible XML file from the .coverage file.




回答2:


There is a plugin written for nosetests to do just this.

You just have to add --with-xcoverage once this package is installed. It can be found at:

https://github.com/cmheisel/nose-xcover



来源:https://stackoverflow.com/questions/4755131/how-to-output-coverage-xml-with-nosetests

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