py.test and HTML output

Carl Friedrich Bolz cfbolz at gmx.de
Wed Sep 20 17:58:48 EDT 2006


Hi Victor!

Victor Ng wrote:
> Is there documentation anywhere on how to get py.test to emit nice
> HTML output like the kind that they have for the PyPy project here:
> http://codespeak.net/~hpk/pypy-testresult/ ?

The code that produces that page is rather ad-hoc and PyPy specific,
though maybe you can reuse parts of it. We plan to add better HTML (and
also PDF) reporting in the future, but currently there is a bit too much
going on.

There is some preliminary HTML reporting integrated in the new
distributed test runner that distributes tests across machines:

http://codespeak.net/py/current/doc/test.txt

(search for "distributed"). At one point this HTML reporter should be
made available for non-distributed test runs too (and made more pretty etc.)

> Should I just redirect the stdout to a StringIO and parse the output
> and generate the HTML myself?  I see that there's a htmlreport.py in
> pypy, but I'm not sure how to use it.

The htmlreport.py in PyPy is only used for a very specific situation,
namely for the stdlib compliance tests. It's not very usable in general.
More interesting could be Armin's nightly test runner, which is (I
think) pretty project independent, but I cannot find the source
currently. An example output looks like this:

http://scottdial.com/pypytest/summary.html

Maybe you could write to the py-lib mailing list, where more people are
listening?

py-dev at codespeak.net

We are always interested to hear from users and discuss interesting new
features.

Cheers,

Carl Friedrich Bolz




More information about the Python-list mailing list