[soc2008-general] unit testing the standard library

Titus Brown titus at caltech.edu
Tue Mar 25 23:31:19 CET 2008


On Tue, Mar 25, 2008 at 11:32:18PM +0100, Christian Heimes wrote:
-> Titus Brown schrieb:
-> > oooh, nice suggestions!
-> 
-> I've plenty of more tasks ;)
-> 
-> * a rich set of requirement rules:
-> 
-> @requires_os("posix")
-> @requires_resource("network")
-> @requires("select.epoll")
-> def test_epoll(self):
->     ...
-> 
-> The rules should work on functions and classes

this can be done with nose tags easily enough, although there may be
value in laying down some rules.

-> * a set of additional assert functions for common issues
-> 
-> assertContains(var, sequence)
-> assertContainsNot(var, sequence)
-> assertIs(var, var)
-> assertIsNot(var, var)
-> assertIsInstance(var, class)
-> assertNotIsInstance(var, class)
-> assertIsSubclass(class, class)
-> assertNotIsSubclass(class, class)

ick.  Pollutes namespace for no visible gain.  What's wrong with "assert
var in sequence"?? :)

-> * html output of test runs with coloring of skipped, failed and
-> successed tests

I believe nose and py.test do this already.

As I will keep on saying until someone implements it: providing a
minimal infrastructure for regrtest that enables all of this and then
nose-/py.test-enabling regrtest for nose- and py.test-aficionados
is the way to go... those toolkits move a lot faster than core CPython.

cheers,
--titus


More information about the soc2008-general mailing list