code: def test_setup():
      # insufficient arguments
      check_setup_parser([], 2)
      assert_in(
          "too few arguments", check_setup_parser(["datalad"], 2)["err"]
      )
      assert_in(
          ".", check_setup_parser(["datalad", "--version"], 0)["out"]
      )
      parser = check_setup_parser(["datalad", "wtf"])["parser"]
      # check into the guts of argparse to check that really only a single
      # subparser was constructed
      assert_equal(
          list(parser._positionals._group_actions[0].choices.keys()),
          ["wtf"],
      )
  
imports: from io import StringIO
  from unittest.mock import patch
  from datalad.tests.utils_pytest import assert_equal, assert_in, assert_raises
  from ..parser import fail_with_short_help, setup_parser
label_desc: Use image node_id 3 for calling a global function with example usage: test_setup() without return types