def read_test_spec(filename, verbose=False):
  """
  Read an SBP test specification.

  Parameters
  ----------
  filename : str
    Local filename for specification.
  verbose : bool
    Print out some debugging info

  Returns
  ----------

  Raises
  ----------
  Exception
    On empty file.
  yaml.YAMLError
    On Yaml parsing error
  voluptuous.Invalid
    On invalid SBP schema
  """
  contents = None
  with open(filename, 'r') as f:
    contents = yaml.load(f)
    if contents is None:
      raise Exception("Empty yaml file: %s." % filename)
    try:
      t.test_schema(contents)
    except Exception as e:
      sys.stderr.write("Invalid SBP test YAML specification: %s.\n" % filename)
      raise e
  return contents
def read_test_spec ( filename , verbose = False ) : contents = None with open ( filename , 'r' ) as f : contents = yaml . load ( f ) if contents is None : raise Exception ( "Empty yaml file: %s." % filename ) try : t . test_schema ( contents ) except Exception as e : sys . stderr . write ( "Invalid SBP test YAML specification: %s.\n" % filename ) raise e return contents
Read an SBP test specification.

  Parameters
  ----------
  filename : str
    Local filename for specification.
  verbose : bool
    Print out some debugging info

  Returns
  ----------

  Raises
  ----------
  Exception
    On empty file.
  yaml.YAMLError
    On Yaml parsing error
  voluptuous.Invalid
    On invalid SBP schema