def test_canonical_error(data_filename, canonical_filename, verbose=False): data = open(data_filename, 'rb').read() try: output = list(yaml.canonical_load_all(data)) except yaml.YAMLError, exc: if verbose: print exc
def test_canonical_error(data_filename, canonical_filename, verbose=False): data = open(data_filename, 'rb').read() try: output = list(yaml.canonical_load_all(data)) except yaml.YAMLError as exc: if verbose: print(exc) else: raise AssertionError("expected an exception")