nice html reports for pyunit

主宰稳场 提交于 2019-12-20 20:18:40

问题


Do you know a tool for creating nice html reports for pyunit?


回答1:


I suggest the following:

  1. Run your tests using nose
  2. Create a nose plugin that outputs results as HTML. The nose example code has a simple HTML output plugin (https://raw.github.com/nose-devs/nose/master/examples/html_plugin/htmlplug.py). You can probably use that, at least as a starting point.

Nose plug-in documentation: http://nose.readthedocs.org/en/latest/index.html

Another option:

  • Nose can output test results as NUnit-compatible XML: nosetests --with-xunit. This will produce a nostests.xml file in the current directory.
  • There are solutions to convert this XML to HTML:
    • For instance, Hudson/Jenkins displays XML test results as HTML in the browser.
    • How to convert NUnit output into an HTML report
    • http://www.google.com/search?&q=nunit+xml+to+html



回答2:


there has a simple HTMLTestRunner developed for pyunit, here is link

The shortage of it is there are no output in console, because sys.stdout and sys.stderr was captured by HTMLTestRunner. Except above, others works fine to me.



来源:https://stackoverflow.com/questions/767377/nice-html-reports-for-pyunit

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