diff --git a/doc/en/reference.rst b/doc/en/reference.rst index f58881d02..2fab4160c 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -1564,7 +1564,7 @@ passed multiple times. The expected format is ``name=value``. For example:: .. confval:: required_plugins A space separated list of plugins that must be present for pytest to run. - If any one of the plugins is not found, emit a error. + If any one of the plugins is not found, emit an error. .. code-block:: ini diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 16bf75b6e..07985df2d 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1087,7 +1087,7 @@ class Config: def _validate_keys(self) -> None: for key in sorted(self._get_unknown_ini_keys()): - self._emit_warning_or_fail("Unknown config ini key: {}\n".format(key)) + self._warn_or_fail_if_strict("Unknown config ini key: {}\n".format(key)) def _validate_plugins(self) -> None: required_plugins = sorted(self.getini("required_plugins")) @@ -1108,7 +1108,7 @@ class Config: pytrace=False, ) - def _emit_warning_or_fail(self, message: str) -> None: + def _warn_or_fail_if_strict(self, message: str) -> None: if self.known_args_namespace.strict_config: fail(message, pytrace=False) sys.stderr.write("WARNING: {}".format(message))