[TIP] How do I get nose to add the cwd to sys.path?

Grig Gheorghiu grig at gheorghiu.net
Thu Nov 13 14:46:40 PST 2008

--- On Thu, 11/13/08, Daryl Spitzer <daryl.spitzer at gmail.com> wrote:

> That did the trick.  I went with:
> from os.path import dirname, abspath
> import sys
> sys.path.append(dirname(dirname(abspath(__file__))))
> Thanks.
> But shouldn't that be unnecessary?

I don't think nose should necessarily do that automagically. Less magic is better IMO. Having those 2 lines in __init__.py is a small price to pay I think.


More information about the testing-in-python mailing list