code: def exit(
      reason: str = "",
      returncode: Optional[int] = None,
      *,
      msg: Optional[str] = None,
  ) -> NoReturn:
      """Exit testing process.
  
      :param reason:
          The message to show as the reason for exiting pytest.  reason has a default value
          only because `msg` is deprecated.
  
      :param returncode:
          Return code to be used when exiting pytest. None means the same as ``0`` (no error), same as :func:`sys.exit`.
  
      :param msg:
          Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead.
      """
      __tracebackhide__ = True
      from _pytest.config import UsageError
  
      if reason and msg:
          raise UsageError(
              "cannot pass reason and msg to exit(), `msg` is deprecated, use `reason`."
          )
      if not reason:
          if msg is None:
              raise UsageError("exit() requires a reason argument")
          warnings.warn(
              KEYWORD_MSG_ARG.format(func="exit"), stacklevel=2
          )
          reason = msg
      raise Exit(reason, returncode)
  
imports: import sys
  import warnings
  from typing import Any
  from typing import Callable
  from typing import cast
  from typing import NoReturn
  from typing import Optional
  from typing import Type
  from typing import TypeVar
  from _pytest.deprecated import KEYWORD_MSG_ARG
label_desc: Use image node_id 2 for calling a global function with example usage: exit(reason, returncode) without return types