<s> import sys <EOL> sys . path . append ( '<STR_LIT:..>' ) <EOL> import pygraph <EOL> import unittest <EOL> import testlib <EOL> import logging <EOL> from os import listdir <EOL> log = logging . getLogger ( __name__ ) <EOL> def test_modules ( ) : <EOL> modlist = [ ] <EOL> for each in listdir ( '<STR_LIT:.>' ) : <EOL> if ( each [ <NUM_LIT:0> : <NUM_LIT:9> ] == "<STR_LIT>" and each [ - <NUM_LIT:3> : ] == "<STR_LIT>" ) : <EOL> modlist . append ( each [ <NUM_LIT:0> : - <NUM_LIT:3> ] ) <EOL> return modlist <EOL> def run_tests ( ) : <EOL> for each_size in testlib . sizes : <EOL> print ( "<STR_LIT>" % each_size ) <EOL> suite = unittest . TestSuite ( ) <EOL> testlib . use_size = each_size <EOL> for each_module in test_modules ( ) : <EOL> try : <EOL> suite . addTests ( unittest . TestLoader ( ) . loadTestsFromName ( each_module ) ) <EOL> except ImportError as ie : <EOL> log . exception ( ie ) <EOL> continue <EOL> tr = unittest . TextTestRunner ( verbosity = <NUM_LIT:2> ) <EOL> result = tr . run ( suite ) <EOL> del suite <EOL> def main ( ) : <EOL> try : <EOL> rseed = sys . argv [ <NUM_LIT:1> ] <EOL> testlib . random_seed = int ( rseed ) <EOL> except : <EOL> pass <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" % testlib . random_seed ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> run_tests ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
