Importing a package and looping through modules in the package
Rich Krauter
rmkrauter at yahoo.com
Mon Feb 9 23:39:39 EST 2004
On Mon, 2004-02-09 at 22:29, Dave wrote:
> Hi Everyone,
>
> I am trying to import a package and then loop through the modules
> inside the package, but I'm running to a problem. Basically:
> -----
> I have a package called
> regression.changepassword.unittests which contains test modules.
> ---
> In a test agent module (called agent.a), I do the following:
>
> from regression.changepassword.unittests import *
> utilities.runTests("regression.changepassword.unittests.")
Do you have __all__ defined in your __init__.py in
regression.changepassword.unittests?
This part of the tutorial might help:
http://www.python.org/doc/current/tut/node8.html#SECTION008410000000000000000
Rich
More information about the Python-list
mailing list