def getoption(self, name: str, default: Any = notset, skip: bool = False):
        """Return command line option value.

        :param name: Name of the option. You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Fallback value if no option of that name is **declared** via :hook:`pytest_addoption`.
            Note this parameter will be ignored when the option is **declared** even if the option's value is ``None``.
        :param skip: If ``True``, raise :func:`pytest.skip` if option is undeclared or has a ``None`` value.
            Note that even if ``True``, if a default was specified it will be returned instead of a skip.
        """
        name = self._opt2dest.get(name, name)
        try:
            val = getattr(self.option, name)
            if val is None and skip:
                raise AttributeError(name)
            return val
        except AttributeError as e:
            if default is not notset:
                return default
            if skip:
                import pytest

                pytest.skip(f"no {name!r} option found")
            raise ValueError(f"no option named {name!r}") from e
Return command line option value.

        :param name: Name of the option. You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Fallback value if no option of that name is **declared** via :hook:`pytest_addoption`.
            Note this parameter will be ignored when the option is **declared** even if the option's value is ``None``.
        :param skip: If ``True``, raise :func:`pytest.skip` if option is undeclared or has a ``None`` value.
            Note that even if ``True``, if a default was specified it will be returned instead of a skip.
        
src/_pytest/config/__init__.py