def test_networkxs_to_graphs_tuple_raises_key_error(self):
    """If the "features" field is not present in the nodes or edges."""
    graph_nx = _single_data_dict_to_networkx(self.graphs_dicts_in[-1])
    first_node = list(graph_nx.nodes(data=True))[0]
    del first_node[1]["features"]
    with self.assertRaisesRegexp(
        KeyError, "This could be due to the node having been silently added"):
      utils_np.networkxs_to_graphs_tuple([graph_nx])
    graph_nx = _single_data_dict_to_networkx(self.graphs_dicts_in[-1])
    first_edge = list(graph_nx.edges(data=True))[0]
    del first_edge[2]["features"]
    with self.assertRaises(KeyError):
      utils_np.networkxs_to_graphs_tuple([graph_nx])
If the "features" field is not present in the nodes or edges.
graph_nets/tests/utils_np_test.py