def METHOD_NAME(true_backend, true_device):
    with pytest.raises(ValueError, match=r"Horovod has not been initialized"):
        hvd.rank()
    assert _HorovodDistModel.create_from_context() is None
    hvd.init()
    true_conf = {
        "device": true_device,
        "local_rank": 0,
        "rank": 0,
        "world_size": 1,
        "node_index": 0,
        "nnodes": 1,
        "nproc_per_node": 1,
    }
    model = _HorovodDistModel.create_from_context()
    assert model.backend() == true_backend
    _assert_model(model, true_conf)
    hvd.shutdown()