def METHOD_NAME(tmp_path, invalid_project_contents, expected_error_msg):
    tmp_path.joinpath("MLproject").write_text(invalid_project_contents)
    with pytest.raises(ExecutionException, match=expected_error_msg) as e:
        _project_spec.load_project(str(tmp_path))
    assert expected_error_msg in str(e.value)