code: def test_csv_to_array(tmp_path):
      # Create a phony CSV file
      fd, filename = tempfile.mkstemp(suffix=".csv", dir=tmp_path)
      os.close(fd)
      try:
          with open(filename, mode="w") as fp:
              fp.write("1.,2.,3.,4.,5.\n")
          assert np.allclose(
              csv_to_array(filename),
              np.asarray([1.0, 2.0, 3.0, 4.0, 5.0]),
          )
          with pytest.raises(TypeError):
              csv_to_array(filename, delimiters="?!")
      finally:
          os.remove(filename)
  
file_path: nilearn/nilearn/_utils/tests/test_numpy_conversions.py
imports: import os
  import tempfile
  import numpy
  import pytest
  from nilearn._utils.numpy_conversions import as_ndarray, csv_to_array
label_desc: Use image node_id 6 for calling a global function with example usage: test_csv_to_array(tmp_path) without return types