[TIP] Green and Red bars

Natalia Bidart nataliabidart at gmail.com
Sat Oct 9 13:37:10 PDT 2010

Hello List!

First of all, I'll introduce myself: I'm Natalia, I live in Argentina
and I've been following the list since PyCon USA 2010. I must confess
that back then I loved Michael's and Ned's talks, and (mainly) because
of them I joined the list.

The reason of my writing is that I'll be giving a talk about Testing
at PyCon Argentina 2010, which will take place next October 15th and
16th, and I need some input from you all. I'm very fond to the concept
of "getting a green bar" (ergo also to the concept of "red bar"), but
I'm finding some problems on actually getting a *green* or *red* bar
using the unittest runner.

What do I mean? I mean that I want colors! Not because they are nice
to watch, but because they are a great, easily and understandable
indicator of how good or bad things are, and because we can easily
detect whether we're at a point when we need to add some code to make
a test pass, or even better we're in shape to add another test.
My test runner of choice is trial mainly because of this, you get a
lovely visual verdict when running the test suite. But since I'm
giving this talk to potential newbies on testing, I would like to
stick to showing/using only unittest (and unittest2), and to not
depend on trial (though I will mention/recommend it at the end).

Summing up: is there any way of getting green/red bars using unittest?


More information about the testing-in-python mailing list