[TIP] Running functional tests frequently without installing frequently

akira 4kir4.1i at gmail.com
Fri Nov 12 18:58:12 PST 2010


On 11/12/2010 07:45 PM, Geoff Bache wrote:
> Hi all,
>
> [snip]
> 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 :)
You can run: `pip install -e ./` once.
> [snip]
>
> - 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?
>
Here's some tools I find useful:

- nose: run/discover tests
- fabric: write deployment/sysadmin scripts (fabfile.py) in Python
- tox: install/test on multiple Python interpreters for simple projects
- hudson: run repeatable tasks e.g, long tests
       easy to use continuous integration server


--
akira



More information about the testing-in-python mailing list