<s> import unittest <EOL> import os <EOL> import re <EOL> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , '<STR_LIT:.>' ) <EOL> V7_TEST_DIR = '<STR_LIT>' <EOL> def collect_tests ( ) : <EOL> names = os . listdir ( V7_TEST_DIR . replace ( '<STR_LIT:.>' , os . path . sep ) ) <EOL> regex = re . compile ( "<STR_LIT>" ) <EOL> join = '<STR_LIT:.>' . join <EOL> names = [ join ( [ V7_TEST_DIR , f [ : - <NUM_LIT:3> ] ] ) for f in names if regex . match ( f ) ] <EOL> modules = [ __import__ ( name , fromlist = [ V7_TEST_DIR ] ) for name in names ] <EOL> suites = [ unittest . TestLoader ( ) . loadTestsFromModule ( m ) for m in modules ] <EOL> suite = suites . pop ( ) <EOL> for s in suites : <EOL> suite . addTests ( s ) <EOL> print suite <EOL> return suite <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> suite = collect_tests ( ) <EOL> res = unittest . TextTestRunner ( verbosity = <NUM_LIT:1> ) . run ( suite ) <EOL> raise SystemExit ( not res . wasSuccessful ( ) ) </s>
