code: def test_bad_diminfo():
      fname = pjoin(data_path, "minc2_baddim.mnc")
      # File has a bad spacing field 'xspace' when it should be
      # `irregular`, `regular__` or absent (default to regular__).
      # We interpret an invalid spacing as absent, but warn.
      with pytest.warns(UserWarning) as w:
          Minc2Image.from_filename(fname)
  
file_path: nibabel/nibabel/tests/test_minc2.py
imports: from os.path import join
  import numpy
  import pytest
  from ..None import minc2
  from ..minc2 import Minc2File, Minc2Image
  from ..optpkg import optional_package
  from ..testing import data_path
  from .None import test_minc1
label_desc: Use image node_id 1 for calling a global function with example usage: test_bad_diminfo() without return types