def test_load_config_invalid_yaml(): file_contents = """ you: - will - not - parse """ with pytest.raises(TrainerConfigError): fp = io.StringIO(file_contents) _load_config(fp)
def test_load_config_valid_yaml(): file_contents = """ this: - is fine """ fp = io.StringIO(file_contents) res = _load_config(fp) assert res == {"this": ["is fine"]}