Continuous testing with Python

Posted by Patrice Neff Sat, 07 Feb 2009

Back when I did some Ruby on Rails development I was a big fan of autotest. With it I could stay in my editor while the project test suite got executed with every change.


Now that I’m working in Python I was looking for something similar and I was successful. You’ll need the following:

Then you can execute tdaemon like this in your project directory:

Usage --custom-args='--with-growl'

This will continually execute the test suite and notify you with growl about the status as you can see in this screencast:



To get this working as shown in the screencast I actually had to make some changes.

First nosegrowl didn’t install well using easy_install as the images were missing. So I went ahead and did it manually:

$ hg clone
$ cd nosegrowl/nose-growl/
$ sed -i.bak 's/growl.start/# growl.start/' nosegrowl/
$ python install

The 'sed’ command is optional. But I don’t want to be notified when the test suite starts, only when it ends. So I uncomment the growl.start line.

Additionally to make tdaemon less noisy when working with vim I added the swap files to the exclude list. Open the file and edit the IGNORE_EXTENSIONS line to look like this:

IGNORE_EXTENSIONS = ('pyc', 'pyo', 'swp')