code: def test_schema_as_feature_spec_fails(
      self,
      ascii_proto,
      error_msg,
      error_class=ValueError,
      generate_legacy_feature_spec=False,
  ):
      schema_proto = text_format.Parse(ascii_proto, schema_pb2.Schema())
      schema_utils_legacy.set_generate_legacy_feature_spec(
          schema_proto, generate_legacy_feature_spec
      )
      with self.assertRaisesRegex(error_class, error_msg):
          schema_utils.schema_as_feature_spec(schema_proto)
  
file_path: transform/tensorflow_transform/tf_metadata/schema_utils_test.py
imports: from absl.testing import parameterized
  from tensorflow_transform.tf_metadata import schema_utils_legacy
  from tensorflow_transform.tf_metadata import schema_utils_test_cases
  from tensorflow_transform.tf_metadata import schema_utils
  from google.protobuf import text_format
  import unittest
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 3 for calling the SchemaUtilsTest obj's underlying member method code with example usage: obj.test_schema_as_feature_spec_fails(ascii_proto, error_msg, error_class, generate_legacy_feature_spec) without return types