MCPcopy Create free account
hub / github.com/pytest-dev/pytest / error

Method error

src/_pytest/config/argparsing.py:406–414  ·  view source on GitHub ↗

Transform argparse error message into UsageError.

(self, message: str)

Source from the content-addressed store, hash-verified

404 self.extra_info = extra_info if extra_info else {}
405
406 def error(self, message: str) -> "NoReturn":
407 """Transform argparse error message into UsageError."""
408 msg = f"{self.prog}: error: {message}"
409
410 if hasattr(self._parser, "_config_source_hint"):
411 # Type ignored because the attribute is set dynamically.
412 msg = f"{msg} ({self._parser._config_source_hint})" # type: ignore
413
414 raise UsageError(self.format_usage() + msg)
415
416 # Type ignored because typeshed has a very complex type in the superclass.
417 def parse_args( # type: ignore

Callers 2

parse_argsMethod · 0.95
_parse_optionalMethod · 0.95

Calls 1

UsageErrorClass · 0.90

Tested by

no test coverage detected