def METHOD_NAME(mol_with_subgraph, weight):
    """
    Test that :func:`average_beads.do_average_bead` fails if a weight is missing.
    """
    del mol_with_subgraph.nodes[0]['graph'].nodes[1][weight]
    with pytest.raises(KeyError):
        average_beads.do_average_bead(
            mol_with_subgraph, ignore_missing_graphs=False, weight=weight,
        )