code: def test_metaclass_raises_if_argument_values_of_expose_arent_subclasses_of_basetype():
      # try in `inputs` field
      with pytest.raises(TypeError, match="must be subclass of"):
  
          class FailedExposedDecoratorInputs(ModelComponent):
              def __init__(self, model):
                  self.model = model
  
              @expose(inputs={"param": int}, outputs={"foo": Number()})
              @staticmethod
              def predict(param):
                  return param
  
      # try in `outputs` field
      with pytest.raises(TypeError, match="must be subclass of"):
  
          class FailedExposedDecoratorOutputs(ModelComponent):
              def __init__(self, model):
                  self.model = model
  
              @expose(inputs={"param": Number()}, outputs={"foo": int})
              @staticmethod
              def predict(param):
                  return param
  
      # try to pass a class definition, not an instance
      with pytest.raises(TypeError, match="must be subclass of"):
  
          class FailedExposedDecoratorClass(ModelComponent):
              def __init__(self, model):
                  self.model = model
  
              @expose(
                  inputs={"param": Number}, outputs={"foo": Number()}
              )
              @staticmethod
              def predict(param):
                  return param
  
file_path: lightning-flash/tests/core/serve/test_gridbase_validations.py
imports: import pytest
  from flash.core.serve import ModelComponent, expose
  from flash.core.serve.types import Number
  from flash.core.utilities.imports import _CYTOOLZ_AVAILABLE, _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 7 for calling a global function with example usage: test_metaclass_raises_if_argument_values_of_expose_arent_subclasses_of_basetype() and returns: param, param, param