def test_none_throws_error(self, none_field):
    """Tests that an error is thrown if a GraphsTuple field is None."""
    graphs_tuple = utils_np.data_dicts_to_graphs_tuple([self.graphs_dicts[1]])
    graphs_tuple = graphs_tuple.replace(**{none_field: None})
    with self.assertRaisesRegex(
        ValueError, "`{}` was `None`. All fields of the `G".format(none_field)):
      utils_tf.specs_from_graphs_tuple(graphs_tuple)
Tests that an error is thrown if a GraphsTuple field is None.
graph_nets/tests/utils_tf_test.py