def test_networkxs_to_graphs_tuple_raises_assertion_error(self):
    """Either all nodes (resp. edges) should have features, or none of them."""
    graph_nx = _single_data_dict_to_networkx(self.graphs_dicts_in[-1])
    first_node = list(graph_nx.nodes(data=True))[0]
    first_node[1]["features"] = None
    with self.assertRaisesRegexp(
        ValueError, "Either all the nodes should have features"):
      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]
    first_edge[2]["features"] = None
    with self.assertRaisesRegexp(
        ValueError, "Either all the edges should have features"):
      utils_np.networkxs_to_graphs_tuple([graph_nx])
Either all nodes (resp. edges) should have features, or none of them.
graph_nets/tests/utils_np_test.py