code: def test_nibabel_test(verbose, v_args, doctests, coverage):
      expected_args = v_args + [
          "--doctest-modules",
          "--cov",
          "nibabel",
          "--pyargs",
          "nibabel",
      ]
      if not doctests:
          expected_args.remove("--doctest-modules")
      if not coverage:
          expected_args[-4:-2] = []
  
      with mock.patch("pytest.main") as pytest_main:
          nib.test(
              verbose=verbose, doctests=doctests, coverage=coverage
          )
  
      args, kwargs = pytest_main.call_args
      assert args == ()
      assert kwargs == {"args": expected_args}
  
imports: import pathlib
  from unittest import mock
  import pytest
  import nibabel
label_desc: Use image node_id 1 for calling a global function with example usage: test_nibabel_test(verbose, v_args, doctests, coverage) without return types