Path Puzzles

dogboy777 at dogboy777 at
Fri Mar 3 15:41:08 CET 2000

I've started using Steve Purcell's wonderful PyUnit test framework, and I've
run into a problem with paths and modules.  I want to store all of my test
modules, test files,  in a subdirectory.  What that means is that if, for
example, I have a module called and an associated testing module
called, I need to import command. py into needs to know to look for in's parent

So far, I've kludged the problem by setting PYTHONPATH in DOS before I run
the script from DOS or Linux (we use Samba to map our Win95 clients to our
Linux server).	This works, but it means that every time I create a new
project which will have its own test subdirectory, I've got to change
PYTHONPATH.  There's got to be a better way, right?

The other wierd little problem I ran into was that when I created
and, their testing modules freaked and refused to call them: 
self.commands = commands.Commands()  would return an "attribute error:
Commands".  However, when I renamed to and
to, it worked fine.	Is this because Python already has modules
further up the PYTHONPATH called and, or did I goof up
in some other way?

Anders Schneiderman
National Journal Daily Briefings
Technology Production Manager

Sent via
Before you buy.

More information about the Python-list mailing list