def test_missing_field_raises_exception(
      self, use_edges, use_receiver_nodes, use_sender_nodes, use_globals,
      none_fields):
    """Checks that missing a required field raises an exception."""
    input_graph = self._get_input_graph(none_fields)
    edge_block = blocks.EdgeBlock(
        edge_model_fn=self._edge_model_fn,
        use_edges=use_edges,
        use_receiver_nodes=use_receiver_nodes,
        use_sender_nodes=use_sender_nodes,
        use_globals=use_globals)
    with self.assertRaisesRegexp(ValueError, "field cannot be None"):
      edge_block(input_graph)
Checks that missing a required field raises an exception.
graph_nets/tests/blocks_test.py