def yaml(self, yaml_version=None): from srsly.ruamel_yaml import YAML y = YAML() y.preserve_quotes = True if yaml_version: y.version = yaml_version return y
def test_issue_245(self): from srsly.ruamel_yaml import YAML inp = """ d: yes """ for typ in ["safepure", "rt", "safe"]: if typ.endswith("pure"): pure = True typ = typ[:-4] else: pure = None yaml = YAML(typ=typ, pure=pure) yaml.version = (1, 1) d = yaml.load(inp) print(typ, yaml.parser, yaml.resolver) assert d["d"] is True