Monday, May 11, 2009

bundling testing with your program... Ubuntu does too with Jaunty.

Ubuntu, with the latest release Jaunty, has a new application called "System Testing" which allows users to run system test.

The program is called checkbox, and you can run it by selecting it from the menu:
    System -->Administration-->System Testing
Now it's not a bunch of unittests... but instead it is a bunch of interactive tests. It's written in python too.

It asks you some questions, and you need to perform the tests manually, and tell it if things worked correctly.

At the end you can send the test results and the details gathered to the Ubuntu hardware database if you choose.

As mentioned in 'pygame.test - moving testing forward', 'pygame.tests and pygame.examples as packages' and 'Distributed testing - the easy way.' installing tests with your program lets way more people test your shit.

So why not join numpy, cherrypy, pygame, ubuntu and others in installing tests with your program or package?
    >>> import yourpackage.tests

python -m yourpackage.tests
Why hasn't python started to install it's tests so that everyone can run them... not just developers? Maybe jython, pypy, or ironpython will be first.

Update: as Marius in the comments suggests... 'python -m yourpackage.tests' is nicer than 'python -c "yourpackage.tests.go". Also it appears python has installed it's tests afterall... I did some digging, and if your packager has installed them... you can run CPythons tests with
    python -m test.autotest

1 comment:

Marius Gedminas said...

I'd suggest
python -m yourpackage.tests