Any open source utilities built on top of PyUnit?
Andrew Bennetts
andrew-pythonlist at puzzling.org
Mon Jul 28 20:18:08 EDT 2003
On Mon, Jul 28, 2003 at 09:03:15AM -0700, J. Michael Hammond wrote:
[...]
> I've gone through the PyUnit documentation the decision comes down to
> this: are there any utilities out there, built on top of PyUnit, that
> are gaining traction? Say is there some kind of GUI package that
> allows easy "run these suites on these machines" sorts of things? Or
> a test results reporting package? Or any other things like that?
This is really orthogonal to what unit test library (and what language!) you
use, but BuildBot (http://buildbot.sourceforge.net/) can automatically run
tests on various machines for you when you checkin to your source
repository. I believe there's also a "try" command in the works, so you can
tell BuildBot to "try" a set of changes on various buildslaves, to check
that you haven't broken anything unexpected (and without needing to checkin
your code to find out).
Also, Twisted (http://twistedmatrix.com/) has a PyUnit-like utility of its
own, Trial. It is almost API-compatible with PyUnit, but comes with a handy
command-line utility, 'trial', that lets you specify which tests to run on
the command-line, e.g.:
trial mypackage.tests # run all tests in mypackage.tests
trial mypackage/tests # ditto
trial mypackage.tests.test_foo # run all testcases in test_foo.py
trial mypackage/tests/test_foo.py # ditto
# run only one testcase
trial mypackage.tests.test_foo.BarTestCase
# run only one test method
trial mypackage.tests.test_foo.BarTestCase.test_baz
I find this to be a much nicer way to work than by sprinkling magic
if __name__ == '__main__':
unittest.main()
stanzas in all my tests, then having to figure out the right magic to write
a "test_all.py" or something to run all the tests.
Hope this helps,
-Andrew.
More information about the Python-list
mailing list