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

Jesse Noller jnoller at gmail.com
Wed Sep 17 13:32:53 PDT 2008


On Wed, Sep 17, 2008 at 4:27 PM, Pete <pfein at pobox.com> wrote:
> 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

I/we could hack it out exceedingly quickly - what do you see it doing,
accepting in a URL and unzipping it? Do you want it to be a command
line argument (i.e: url) or an artifact in the nose config file?



More information about the testing-in-python mailing list