code: def test_nib_roi_bad_slices(capsys, args, errmsg):
      in_file = os.path.join(data_path, "functional.nii")
  
      retval = main([in_file, os.devnull, *args])
      assert retval != 0
      captured = capsys.readouterr()
      assert errmsg in captured.out
  
file_path: nibabel/nibabel/cmdline/tests/test_roi.py
imports: import os
  import unittest
  from unittest import mock
  import numpy
  import pytest
  import nibabel
  from nibabel.cmdline.roi import lossless_slice, main, parse_slice
  from nibabel.testing import data_path
label_desc: Use image node_id 7 for calling a global function with example usage: test_nib_roi_bad_slices(capsys, args, errmsg) without return types