code: def test_incorrect_option(opts, err_str):
      # The first line used to be:
      # stdout, stderr = run_main((sys.argv[0],) + opts, expect_stderr=True, exit_code=2)
      # But: what do we expect to be in sys.argv[0] here?
      # It depends on how we invoke the test.
      # - nosetests -s -v datalad/cmdline/tests/test_main.py would result in:
      #   sys.argv[0}=='nosetests'
      # - python -m nose -s -v datalad/cmdline/tests/test_main.py would result in:
      #   sys.argv[0}=='python -m nose'
      # - python -c "import nose; nose.main()" -s -v datalad/cmdline/tests/test_main.py would result in:
      #   sys.argv[0]=='-c'
      # This led to failure in case sys.argv[0] contained an option, that was
      # defined to be a datalad option too, therefore was a 'known_arg' and was
      # checked to meet its constraints.
      # But sys.argv[0] actually isn't used by main at all. It simply doesn't
      # matter what's in there. The only thing important to pass here is `opts`.
      stdout, stderr = run_main(opts, expect_stderr=True, exit_code=2)
      out = stdout + stderr
      assert_in("usage: ", out)
      assert_re_in(err_str, out, match=False)
  
imports: import os
  import re
  from io import StringIO
  from unittest.mock import patch
  import pytest
  import datalad
  from datalad import __version__
  from datalad.api import Dataset, create
  from datalad.cmd import StdOutErrCapture
  from datalad.cmd import WitlessRunner
  from datalad.interface.base import get_interface_groups
  from datalad.tests.utils_pytest import SkipTest, assert_equal, assert_in, assert_not_in, assert_raises, assert_re_in, eq_, in_, ok_, ok_startswith, on_windows, skip_if_no_module, slow, with_tempfile
  from datalad.ui.utils import get_console_width, get_terminal_size
  from datalad.utils import chpwd
  from ..helpers import get_commands_from_groups
  from ..main import main
label_desc: Use image node_id 12 for calling a global function with example usage: test_incorrect_option(opts, err_str) without return types