10

I'm looking for any way to display the results of Python unit tests in an HTML summary. There are tools like this for Java and Ruby... haven't yet located any tools that seem to do this for Python. Are there any out there?

JUnit HTML output:

alt text
(source: ibm.com)

Ruby RSpec output:

alt text
(source: natontesting.com)

John Y
  • 14,123
  • 2
  • 48
  • 72
Purrell
  • 12,461
  • 16
  • 58
  • 70
  • 1
    There is a similar question answered here: http://stackoverflow.com/questions/767377/nice-html-reports-for-pyunit – Manny O. Nov 18 '09 at 19:27
  • 2
    yeah... that answer just says "write your own" :P – Purrell Dec 02 '09 at 23:58
  • 1
    Yes, there is something like that written, it's at http://tungwaiyip.info/software/HTMLTestRunner.html. Here is the sample output: http://tungwaiyip.info/software/sample_test_report.html – Purrell Dec 02 '09 at 23:59
  • Questions asking for "libraries, tools, or other offsite resources" are explicitly off topic, because the answers tend to grow stale very quickly. – larsks May 10 '19 at 01:26

1 Answers1

2

There are now ways to do it using Python. Using pytest, for example:

pip install pytest pytest-html

And then:

pytest --html=report.html --self-contained-html

Results in HTML of pytest

vvvvv
  • 25,404
  • 19
  • 49
  • 81