Running Django tests automatically on save in Eclipse
I’m re-installing my environment, while doing so I’m fixing a few things I’ve been missing in my environment.
Running tests using Python is really fast, so I wanted to add something like Autospec but for my tests. So I did the following:
- Right click the project you want to use
- Click properties
- Click on the builders item in the left pane
- Press New
- Select to add a Program builder
- Set python as program to run, your workspace as working directory and the command to run the tests as arguments. In my case I run tests using “manage.py test” from Django.
- On the Build Options page check all the options for when to run the builder
- Now every time I save a file, my test command is run in the console. I get the output in the console window which I’ve moved to the right of my editor,window.
Hope it helps someone, the are probably improvements to this. You are welcome to suggest them in the comments section.