def test_missing_field_raises_exception(
      self, use_edges, use_nodes, use_globals, none_field):
    """Checks that missing a required field raises an exception."""
    input_graph = self._get_input_graph([none_field])
    global_block = blocks.GlobalBlock(
        global_model_fn=self._global_model_fn,
        use_edges=use_edges,
        use_nodes=use_nodes,
        use_globals=use_globals)
    with self.assertRaisesRegexp(ValueError, "field cannot be None"):
      global_block(input_graph)
Checks that missing a required field raises an exception.
graph_nets/tests/blocks_test.py