docstr: ...Test errors raised by typemap in on SparseArray
          
docstr_tok: ["...","Test","errors","raised","by","typemap","in","on","SparseArray"]
code: def test_array_errors_typemap_in(self):
      """...Test errors raised by typemap in on SparseArray"""
      for array_type, info in self.correspondence_dict.items():
          extract_function = info["typemap_in_array_not_ol"]
  
          # Test if we pass something that has no link with a numpy array
          regex_error_random = "Expecting(.*?)numpy(.*?)(a|A)rray"
          self.assertRaisesRegex(
              ValueError, regex_error_random, extract_function, object()
          )
  
          regex_error_sparse = "Expecting.*dense"
          python_sparse_array = info["python_sparse_array"]
          self.assertRaisesRegex(
              ValueError,
              regex_error_sparse,
              extract_function,
              python_sparse_array,
          )
  
          # Test if we pass an array of another type
          regex_error_wrong_type = (
              "Expecting.*%s.*array" % info["cpp_type"]
          )
          other_array_type = [
              key
              for key in self.correspondence_dict.keys()
              if key != array_type
          ][0]
          python_other_type_array = self.correspondence_dict[
              other_array_type
          ]["python_array"]
  
          self.assertRaisesRegex(
              ValueError,
              regex_error_wrong_type,
              extract_function,
              python_other_type_array,
          )
          with self.assertRaisesRegex(ValueError, "contiguous"):
              non_contiguous = np.arange(20).astype(float)[::2]
              extract_function(non_contiguous)
  
          with self.assertRaisesRegex(ValueError, "dimensional"):
              extract_function(np.zeros((5, 5)))
  
          with self.assertRaisesRegex(ValueError, "dimensional"):
              extract_function(np.zeros((5, 5, 5)))
  
imports: import unittest
  import numpy
  from scipy.sparse import csr_matrix
  from tick.array_test.build import array_test
label_desc: Use image node_id 37 for calling the Test obj's underlying member method code with example usage: obj.test_array_errors_typemap_in() without return types