[TIP] Guidelines for where to put tests & how to package them

Michał Kwiatkowski constant.beta at gmail.com
Thu Feb 25 09:23:59 PST 2010


On Thu, Feb 25, 2010 at 2:53 PM, C. Titus Brown <ctb at msu.edu> wrote:
> On Thu, Feb 25, 2010 at 09:23:50AM +0100, Micha? Kwiatkowski wrote:
>> Where the integration tests (i.e. those using multiple packages of a
>> single project) go?
>
> Hi Michal,
>
> I'm not sure.  I don't have much experience with that.  What do you suggest?
>
> If you had an overall "container" package you could put them in there --
> no reason that you couldn't have test packages be interdependent, right?
>
> Or you could just say that integration tests should not be run after install,
> and then have 'python setup.py test' do the honors for developers.

Well, I thought not running tests wasn't an acceptable solution. ;-)

Seriously though, I made a short survey for Pythoscope and there's
roughly the same number of projects that have test directories inside
packages (what you propose) and those that have a single global test
directory. Test directory at the project root is useful also for
integration tests that I mentioned. There are some developers (me
included :-) that feel that having tests in a different location than
the code is actually a good thing.

Check out the complete list here:

http://time-loop.tumblr.com/post/49578950/where-python-developers-keep-their-test-directories

Would it be possible to support both conventions?

Cheers,
mk



More information about the testing-in-python mailing list