code: def test_cachit_exception():
      # Make sure the cache doesn't call functions multiple times when they
      # raise TypeError
  
      a = []
  
      @cacheit
      def testf(x):
          a.append(0)
          raise TypeError
  
      raises(TypeError, lambda: testf(1))
      assert len(a) == 1
  
      a.clear()
      # Unhashable type
      raises(TypeError, lambda: testf([]))
      assert len(a) == 1
  
      @cacheit
      def testf2(x):
          a.append(0)
          raise TypeError("Error")
  
      a.clear()
      raises(TypeError, lambda: testf2(1))
      assert len(a) == 1
  
      a.clear()
      # Unhashable type
      raises(TypeError, lambda: testf2([]))
      assert len(a) == 1
  
file_path: sympy/sympy/core/tests/test_cache.py
imports: import sys
  from sympy.core.cache import cacheit, cached_property, lazy_function
  from sympy.testing.pytest import raises
label_desc: Use image node_id 3 for calling a global function with example usage: test_cachit_exception() without return types