unittest and automatically firing off tests

Steven Taschuk staschuk at telusplanet.net
Sat Jun 21 21:16:43 CEST 2003

Quoth Tom Plunket:
> Why do you call imp.load_module() here rather than __import__ ?

__import__ goes searching in sys.path for the named module.  In
this case that's unnecessary (since we already know where the
files are), a little dangerous (since it risks loading other
modules of the same names earlier in the path), and possibly
ineffective (since the directory containing the test modules might
not be on the path at all).

Steven Taschuk              Aral: "Confusion to the enemy, boy."
staschuk at telusplanet.net    Mark: "Turn-about is fair play, sir."
                             -- _Mirror Dance_, Lois McMaster Bujold

More information about the Python-list mailing list