code: def test_cached_st_function_warning(self, warning):
      st.text("foo")
      warning.assert_not_called()
  
      @st.cache
      def cached_func():
          st.text("Inside cached func")
  
      cached_func()
      warning.assert_called_once()
  
      warning.reset_mock()
  
      # Make sure everything got reset properly
      st.text("foo")
      warning.assert_not_called()
  
      # Test warning suppression
      @st.cache(suppress_st_warning=True)
      def suppressed_cached_func():
          st.text("No warnings here!")
  
      suppressed_cached_func()
  
      warning.assert_not_called()
  
      # Test nested st.cache functions
      @st.cache
      def outer():
          @st.cache
          def inner():
              st.text("Inside nested cached func")
  
          return inner()
  
      outer()
      warning.assert_called_once()
  
      warning.reset_mock()
  
      # Test st.cache functions that raise errors
      with self.assertRaises(RuntimeError):
  
          @st.cache
          def cached_raise_error():
              st.text("About to throw")
              raise RuntimeError("avast!")
  
          cached_raise_error()
  
      warning.assert_called_once()
      warning.reset_mock()
  
      # Make sure everything got reset properly
      st.text("foo")
      warning.assert_not_called()
  
      # Test st.cache functions with widgets
      @st.cache
      def cached_widget():
          st.button("Press me!")
  
      cached_widget()
  
      warning.assert_called_once()
      warning.reset_mock()
  
      # Make sure everything got reset properly
      st.text("foo")
      warning.assert_not_called()
  
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 CacheTest obj's underlying member method code with example usage: obj.test_cached_st_function_warning(warning) and returns: inner