[TIP] why you should distribute tests with your application / module

Pete pfein at pobox.com
Wed Sep 17 13:27:22 PDT 2008


On Sep 17, 2008, at 1:05 PM, Kumar McMillan wrote:

> On Wed, Sep 17, 2008 at 12:52 PM, Grig Gheorghiu  
> <grig at gheorghiu.net> wrote:
>> --- On Wed, 9/17/08, Pete <pfein at pobox.com> wrote:
>>
>>>
>>> I mean for distribution.  My test dataset falls into some
>>> middle
>>> ground - it's a few megabytes. Not the gigabytes that
>>> would lean
>>> towards generation, but still larger than the rest of my
>>> source tree.
>>> Seems silly to turn a 30K package into a 5M one b/c of test
>>> data...
>>>
>>
>> Idea: don't include your test dataset with your source code, but  
>> have your test script wget it from some location during the test  
>> run. Amazon S3 comes to mind as a very cheap repository for this  
>> kind of stuff.
>
> alternatively, you could skip the tests that require the large
> datasets when the datasets are not present.  This way the end user can
> still run unit tests to determine to some degree whether or not the
> installed binary of your package is "working."  In other words, some
> tests are better than no tests.

Yeah, this is pretty much what I had in mind / suggested earlier.   
Seems like this would make a decent nose plugin (--download-test- 
data)... not that I'm likely to write it. ;-)

Thanks all.

--Pete



More information about the testing-in-python mailing list