[TIP] Running functional tests frequently without installing frequently

Marius Gedminas marius at gedmin.as
Fri Nov 12 10:57:47 PST 2010


On Fri, Nov 12, 2010 at 05:45:27PM +0100, Geoff Bache wrote:
> 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.

Fair enough.

> 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 :)

Or you could run setup.py develop once.

> 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's basically what setup.py develop does, only it uses a .pth file
instead of a symlink, IIRC.

> 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

That's what I prefer.

> - write some kind of wrapper script

I've considered automating virtualenv + install + run tests of installed
package, primarily so that I could be sure my setup.py is correct and
doesn't omit any necessary package_data files or whatnot.

Marius Gedminas
-- 
Making software smarter is much easier than making people smarter.
        -- Matthew Paul Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20101112/8cb64ae4/attachment.pgp>


More information about the testing-in-python mailing list