[TIP] Running functional tests frequently without installing frequently
geoff.bache at gmail.com
Fri Nov 12 08:45:27 PST 2010
I asked this question on comp.lang.python but didn't get much of
answer, so I thought I'd see how others on this list deal with this
I like to test my programs very frequently, and by that I mean
actually run them from the command line rather than just unit testing.
For simple programs that is no problem, as I just run them from the
source tree. But for programs with a more complex setup.py, it's more
necessary to have a local virtualenv environment where I can install
it to before running it.
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've fixed this by installing once, and then going into my virtualenv
and replacing the installed package with a symbolic link back to the
original source code. That way I can avoid the install step most of
the time. But it feels like rather a hack. Other strategies seem to be
- do everything possible to make programs always runnable directly
from the source tree
- write some kind of wrapper script
How have other people addressed this issue?
More information about the testing-in-python