def test_missing_field_raises_exception(self, broadcaster, none_fields):
    """Test that an error is raised if a required field is `None`."""
    input_graph = self._get_input_graph(none_fields)
    with self.assertRaisesRegexp(
        ValueError, "field cannot be None when broadcasting"):
      broadcaster(input_graph)
Test that an error is raised if a required field is `None`.
graph_nets/tests/blocks_test.py