def _discover_test_modules(package_dir):
 def is_unittest_module(path):
  file_name = os.path.basename(path)
  return file_name.startswith(UNITTEST_FILE_PREFIX)
 names = get_module_names(package_dir=package_dir, should_include=is_unittest_module)
 if (len(names) < 1):
  raise Exception(('No unit-test modules found--\n  in %s' % package_dir))
 return names

def _discover_test_modules ( package_dir ) : def is_unittest_module ( path ) : file_name = os . path . basename ( path ) return file_name . startswith ( UNITTEST_FILE_PREFIX ) names = get_module_names ( package_dir = package_dir , should_include = is_unittest_module ) if ( len ( names ) < 1 ) : raise Exception ( ( 'No unit-test modules found--\n  in %s' % package_dir ) ) return names
discover and return a sorted list of the names of unit-test modules .