[TIP] data files for testing

Andrea Crotti andrea.crotti.0 at gmail.com
Sun Dec 18 04:45:45 PST 2011


On 12/18/2011 11:57 AM, Marius Gedminas wrote:
> Inserting an installation step between Edit and Test in the development
> loop would be Bad.  On the other hand, you only need to run setup.py
> develop once.  And since any nontrivial package probably includes
> library dependencies, you most likely already need to set up a
> virtualenv and run setup.py develop just to install those for
> development.
>
> Marius Gedminas
>
That's also true, is normally not a big issue, but probably __file__ is
a more general way.
And supposing that I use pkg_resources, how do I find my directories?

pkg_resources.resource_filename should be the right call, but what happens
if there are two directories with the same name in the same egg but in
different
subtrees?



More information about the testing-in-python mailing list