code: def test_backward_warnings(
      framework: types.ModuleType,
      test_model: FrameworkTestModel,
      caplog: LogCaptureFixture,
      saved_model: bentoml.Model,
  ):
      # We want to cover the cases where the user is using the old API
      # and we want to make sure that the warning is raised.
      if (
          not hasattr(framework, "__test_backward_compatible__")
          or framework.__test_backward_compatible__ is False
      ):
          pytest.skip(
              "Module '%s' does not have a backward compatible warning."
              % framework.__name__
          )
      if hasattr(framework, "save"):
          with caplog.at_level(logging.WARNING):
              framework.save(test_model.name, test_model.model)
          assert (
              f'The "{framework.__name__}.save" method is deprecated. Use "{framework.__name__}.save_model" instead.'
              in caplog.text
          )
          caplog.clear()
      if hasattr(framework, "load"):
          with caplog.at_level(logging.WARNING):
              framework.load(saved_model.tag)
          assert (
              f'The "{framework.__name__}.load" method is deprecated. Use "{framework.__name__}.load_model" instead.'
              in caplog.text
          )
          caplog.clear()
      if hasattr(framework, "load_runner"):
          with caplog.at_level(logging.ERROR):
              framework.load_runner(saved_model.tag, "asdf")
              assert (
                  '"load_runner" arguments will be ignored.'
                  in caplog.text
              )
              caplog.clear()
  
          with caplog.at_level(logging.WARNING):
              framework.load_runner(saved_model.tag)
              assert (
                  f'The "{framework.__name__}.load_runner" method is deprecated. Use "{framework.__name__}.get("{saved_model.tag}").to_runner()" instead.'
                  in caplog.text
              )
              caplog.clear()
  
imports: from __future__ import annotations
  import logging
  import os
  import types
  import typing
  from typing import TYPE_CHECKING
  import pytest
  import bentoml
  from bentoml._internal.models.model import ModelContext
  from bentoml._internal.models.model import ModelSignature
  from bentoml._internal.runner.runner import Runner
  from bentoml._internal.runner.runner_handle.local import LocalRunnerRef
  from bentoml._internal.runner.strategy import DefaultStrategy
  from bentoml.exceptions import NotFound
  from .models import FrameworkTestModel
label_desc: Use image node_id 2 for calling a global function with example usage: test_backward_warnings(framework, test_model, caplog, saved_model) without return types