[TIP] Running functional tests frequently without installing frequently

Mark Sienkiewicz sienkiew at stsci.edu
Fri Nov 12 14:00:40 PST 2010


Geoff Bache wrote:
> But the problem then is that I have to remember to run setup.py
> install each time I run the tests, and it's easy to forget this step
> and wonder why your changes don't take effect. It also feels more like
> the bad old days of having to run a compiler first :)


I rarely work on anything that is so simple that you could run it without installing it.  That works if you are building a library or a simple application, but I just don't work on things like that very often.  Depending on the day's work, I have C extensions to compile, configurations to customize, files to edit on the web server (or a web server to start), blah blah blah... 

I use a script.  It usually says something like this:

	python setup.py install --home /xxx/yyy
	export PYTHONPATH=/xxx/yyy/lib/python
	/xxx/yyy/bin/app

but I don't necessarily keep it in the CM system because I always customize it to what I need to do today.  So, for example, tomorrow I might have it run a subset of the tests instead of starting the app.

Even for simple things, I might make a script with just the setup.py line in it.  In one window, I run the editor, in another I run the ./go script by pressing up-arrow return, and in another I hit reload on my browser to see the effect of the changes I made.

It's a pretty simple work flow when you get used to it.

Mark S.




More information about the testing-in-python mailing list