Only run one specific test

Yinon Ehrlich at
Sun May 31 04:30:32 EDT 2009

> Yes, that works indeed. But in practice the modules_to_import list is
> filled by parsing the contents of a test/*.py directory. That's why I
> import dynamically with __import__.
> Nevertheless, you got me on the right track. After I explicitly added
> the modules to the global namespace (globals()["mytest"] =
> __import__("mytest")), it works fine. Thx!

Another way to do it is using imp.load_source,

More information about the Python-list mailing list