[TIP] data files for testing

Andrea Crotti andrea.crotti.0 at gmail.com
Sun Dec 18 03:29:59 PST 2011


On 12/18/2011 12:50 AM, Marius Gedminas wrote:
> On Sat, Dec 17, 2011 at 09:44:48PM +0000, Andrea Crotti wrote:
>> Suppose I have some directories and files that I only use with my unit
>> tests,
>> now how should I address them?
>> .
>> I mean if for example I have
>>
>> package
>>  - test
>>    + fake_directory
>>       + fake_data
> I generally just put something like this into my test_whatever.py
>
>   here = os.path.dirname(__file__)
>   fake_data_path = os.path.join(here, 'fake_directory', 'fake_data')
>
> This does not support zipped eggs, but zipped eggs aren't high on my
> list of things I think I should support.
>
>

Thanks a lot that already solves my problems.
In general I think I could also always include the tests, what I don't
want to do is
to rely on the fact that is installed just to run the tests, which
doesn't seem very right..



More information about the testing-in-python mailing list