trouble with unittest and namespaces - can anyone help?

Lol McBride lol at lolmc.nospam.com
Tue Nov 11 18:17:12 EST 2003


Hi all,
I'm developing an OOP program and trying to be smart by using unittest to
help me to catch as many bugs as possible during development.Unfortunately
I've hit a snag which I believe is to do with namespaces (specifically the
os.path).
The program is split into packages and modules as below:

oop_lb - toplevelpackage
	__init__.py
	oop_lb.py
	analysis
		__init__.py
		prog1.py
		prog2.py
		tests
			testprog1.py
			testprog2.py
	process
		__init__.py
		prog3.py
		prog4.py
		tests
			testprog3.py
			testprog4.py

The programs in analysis do not import classes or modules from anywhere
else and the tests in the tests directory run fine.My problem is with the
tests done for prog3 and prog4, both of which import from the analysis
package e.g
from analysis import prog1

All tests fail to run and a 'no such module as analysis message' is
displayed.
Could anyone give me an idea as to how to resolve this problem?




More information about the Python-list mailing list