def find_tests(testdir, prefixes=DEFAULT_PREFIXES, suffix='.py', excludes=(), remove_suffix=True):
 tests = []
 for name in os.listdir(testdir):
  if ((not suffix) or name.endswith(suffix)):
   for prefix in prefixes:
    if name.startswith(prefix):
     if (remove_suffix and name.endswith(suffix)):
      name = name[:(- len(suffix))]
     if (name not in excludes):
      tests.append(name)
 tests.sort()
 return tests

def find_tests ( testdir , prefixes = DEFAULT_PREFIXES , suffix = '.py' , excludes = ( ) , remove_suffix = True ) : tests = [ ] for name in os . listdir ( testdir ) : if ( ( not suffix ) or name . endswith ( suffix ) ) : for prefix in prefixes : if name . startswith ( prefix ) : if ( remove_suffix and name . endswith ( suffix ) ) : name = name [ : ( - len ( suffix ) ) ] if ( name not in excludes ) : tests . append ( name ) tests . sort ( ) return tests
return a list of all applicable test modules .