rename _emit_warning_or_fail to _warn_or_fail_if_strict and fix a doc typo
This commit is contained in:
parent
c18afb59f5
commit
2c8e356174
|
@ -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
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue