def test_missing_field_raises_exception(
      self, use_received_edges, use_sent_edges, use_nodes, use_globals,
      none_fields):
    """Checks that missing a required field raises an exception."""
    input_graph = self._get_input_graph(none_fields)
    node_block = blocks.NodeBlock(
        node_model_fn=self._node_model_fn,
        use_received_edges=use_received_edges,
        use_sent_edges=use_sent_edges,
        use_nodes=use_nodes,
        use_globals=use_globals)
    with self.assertRaisesRegexp(ValueError, "field cannot be None"):
      node_block(input_graph)
Checks that missing a required field raises an exception.
graph_nets/tests/blocks_test.py