def test_load_file(self, tmpdir): tmpfile = tmpdir / 'foo.yml' tmpfile.write('[1, 2]') with tmpfile.open(encoding='utf-8') as f: assert utils.yaml_load(f) == [1, 2]
def test_load(self): assert utils.yaml_load("[1, 2]") == [1, 2]
def test_load_float_bug(self): try: utils.yaml_load("._") except yaml.YAMLError: # Either no exception or YAMLError, not ValueError pass
def test_load_float_bug(self): with pytest.raises(yaml.YAMLError): utils.yaml_load("._")