docstr: Test if the conversion properly raises an error if someone tries to save the model using `save_pretrained`.
docstr_tok: ["Test","if","the","conversion","properly","raises","an","error","if","someone","tries","to","save","the","model","using","`","save_pretrained","`","."]
code: def test_raise_on_save(self, model_type: str):
      r"""
      Test if the conversion properly raises an error if someone tries to save the model using `save_pretrained`.
      """
      model_ids = (
          MODELS_DICT[model_type]
          if isinstance(MODELS_DICT[model_type], tuple)
          else (MODELS_DICT[model_type],)
      )
      for model_id in model_ids:
          with self.assertRaises(
              ValueError
          ), tempfile.TemporaryDirectory() as tmpdirname:
              hf_model = AutoModel.from_pretrained(model_id).eval()
              bt_model = BetterTransformer.transform(
                  hf_model, keep_original_model=False
              )
              bt_model.save_pretrained(tmpdirname)
  
file_path: optimum/tests/bettertransformer/test_common.py
imports: import tempfile
  import unittest
  from unittest.mock import patch
  import transformers
  from parameterized import parameterized
  from testing_utils import MODELS_DICT
  from transformers import AutoModel
  from optimum.bettertransformer import BetterTransformer, BetterTransformerManager
  from optimum.pipelines import pipeline
  from optimum.utils.testing_utils import grid_parameters
label_desc: Use image node_id 3 for calling the BetterTransformerIntegrationTests obj's underlying member method code with example usage: obj.test_raise_on_save(model_type) without return types