[soc2008-general] unit testing the standard library

Titus Brown titus at caltech.edu
Mon Mar 24 18:33:29 CET 2008


-> Possibly. We need:
-> 
-> * A function that imports the module being tested so that if it isn't
-> imported the test is skipped, but all other import failures are an
-> error.
-> * Some way to specify what OSs the test can be run on, both expected
-> and optionally.
-> * A way to denote whitebox tests specific for CPython.
-> * Rewrite regrtest to use all of this new stuff.
-> 
-> That's everything I ever had an idea for. Most of it, though, is not
-> overly complex (maybe the regrtest rewrite since that file has grown
-> organically).

The attributes stuff that nose uses seems like a perfect way to decorate
the tests with this information; basically, you could say something like

	nosetests -a unix

and have it discover & run only those tests that are UNIX-y.

(I'm not pushing for a general switch to nose or py.test from regrtest,
but the ideas can be swiped easily enough & made compatible with
nose/py.test usage, which might in turn yield all sorts of goodness down
the road for those who *do* use nose/py.test.)

--titus


More information about the soc2008-general mailing list