Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nice html reports for pyunit

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

like image 373
flybywire Avatar asked Apr 20 '09 08:04

flybywire


People also ask

Can Pytest produce HTML report?

To generate a HTML report for a Selenium test, we have to install a plugin with the command: pip install pytest-html. To generate the report, we have to move from the current directory to the directory of the Pytest file that we want to execute. Then run the command: pytest --html=report. html.

Is PyUnit the same as Unittest?

Yes. unittest is a xUnit style frameworkfor Python, it was previously called PyUnit.


1 Answers

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
like image 86
codeape Avatar answered Sep 21 '22 21:09

codeape