(a)
exec( "import %s" % script )
module = locals()[script]
# if this module supports our testing interface
if module.__dict__.has_key( "addTests" ):
module.addTests( ts )
(b)
def addTests( ts ):
    ts.add( BigIntegerTest( "BigIntegerTest" ) )

Example 4: (a) Dynamically loading test modules; (b) example of an addTests method for the BigIntegerTest.py module.

Back to Article