class_docstr: Make sure user-visible error messages look correct.
  
  These errors are a little annoying to test, but they're important! So we
  are testing them word-for-word as much as possible. Even though this
  *feels* like an antipattern, it isn't: we're making sure the codepaths
  that pull useful debug info from the code are working.
docstr: Calling a @st.cache function shows a generic deprecation warning for other types.
docstr_tok: ["Calling","a","@","st.cache","function","shows","a","generic","deprecation","warning","for","other","types","."]
code: def test_generic_deprecation_warning(
      self, show_deprecation_warning: Mock
  ) -> None:
      """Calling a @st.cache function shows a generic deprecation warning for other types."""
  
      class MockClass:
          pass
  
      @st.cache
      def func():
          return MockClass()
  
      show_deprecation_warning.assert_not_called()
  
      self.assertIsInstance(func(), MockClass)
  
      expected_message = (
          "`st.cache` is deprecated. Please use one of Streamlit's new caching commands,\n"
          "`st.cache_data` or `st.cache_resource`.\n\n"
          "More information [in our docs](https://docs.streamlit.io/library/advanced-features/caching)."
      )
      show_deprecation_warning.assert_called_once_with(expected_message)
  
imports: import threading
  import types
  from unittest.mock import Mock, patch
  from parameterized import parameterized
  import streamlit
  from streamlit.elements import exception
  from streamlit.proto.Exception_pb2 import Exception
  from streamlit.runtime.legacy_caching import caching, hashing
  from tests import testutil
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
label_desc: Use image node_id 7 for calling the CacheErrorsTest obj's underlying member method code with example usage: obj.test_generic_deprecation_warning(show_deprecation_warning) and returns: MockClass