@@ -261,7 +261,7 @@ pytest.mark.xfail
261261
262262Marks a test function as *expected to fail *.
263263
264- .. py :function :: pytest.mark.xfail(condition = False , * , reason = None , raises = None , run = True , strict = xfail_strict )
264+ .. py :function :: pytest.mark.xfail(condition = False , * , reason = None , raises = None , run = True , strict = strict_xfail )
265265
266266 :keyword Union[bool, str] condition:
267267 Condition for marking the test function as xfail (``True/False `` or a
@@ -286,7 +286,7 @@ Marks a test function as *expected to fail*.
286286 that are always failing and there should be a clear indication if they unexpectedly start to pass (for example
287287 a new release of a library fixes a known bug).
288288
289- Defaults to :confval: `xfail_strict `, which is ``False `` by default.
289+ Defaults to :confval: `strict_xfail `, which is ``False `` by default.
290290
291291
292292Custom marks
@@ -1774,25 +1774,21 @@ passed multiple times. The expected format is ``name=value``. For example::
17741774
17751775.. confval :: markers
17761776
1777- When the `` --strict-markers `` or `` --strict `` command-line arguments are used ,
1777+ When the :confval: ` strict_markers ` configuration option is set ,
17781778 only known markers - defined in code by core pytest or some plugin - are allowed.
17791779
17801780 You can list additional markers in this setting to add them to the whitelist,
1781- in which case you probably want to add `` --strict-markers `` to ``addopts ``
1781+ in which case you probably want to set :confval: ` strict_markers ` to ``True ``
17821782 to avoid future regressions:
17831783
17841784 .. code-block :: ini
17851785
17861786 [pytest]
1787- addopts = --strict-markers
1787+ strict_markers = True
17881788 markers =
17891789 slow
17901790 serial
17911791
1792- .. note ::
1793- The use of ``--strict-markers `` is highly preferred. ``--strict `` was kept for
1794- backward compatibility only and may be confusing for others as it only applies to
1795- markers and not to other options.
17961792
17971793 .. confval :: minversion
17981794
@@ -2070,7 +2066,33 @@ passed multiple times. The expected format is ``name=value``. For example::
20702066 "auto" can be used to explicitly use the global verbosity level.
20712067
20722068
2073- .. confval :: xfail_strict
2069+ .. confval :: strict
2070+
2071+ If set to ``True ``, enables all strictness options:
2072+
2073+ * :confval: `strict_config `
2074+ * :confval: `strict_markers `
2075+ * :confval: `strict_xfail `
2076+ * :confval: `strict_parametrization_ids `
2077+
2078+ Plugins may also enable their own strictness options.
2079+
2080+ If you explicitly set an individual strictness option, it takes precedence over ``strict ``.
2081+
2082+ .. note ::
2083+ If new strictness options are added to pytest in the future, they will also be enabled by ``strict ``.
2084+ We therefore only recommend using this option when using a locked version of pytest,
2085+ or if you want to proactively adopt new strictness options as they are added.
2086+
2087+ .. code-block :: ini
2088+
2089+ [pytest]
2090+ strict = True
2091+
2092+ .. versionadded :: 9.0
2093+
2094+
2095+ .. confval :: strict_xfail
20742096
20752097 If set to ``True ``, tests marked with ``@pytest.mark.xfail `` that actually succeed will by default fail the
20762098 test suite.
@@ -2080,7 +2102,38 @@ passed multiple times. The expected format is ``name=value``. For example::
20802102 .. code-block :: ini
20812103
20822104 [pytest]
2083- xfail_strict = True
2105+ strict_xfail = True
2106+
2107+ You can also enable this option via the :confval: `strict ` option.
2108+
2109+ .. versionchanged :: 9.0
2110+ Renamed from ``xfail_strict `` to ``strict_xfail ``.
2111+ ``xfail_strict `` is accepted as an alias for ``strict_xfail ``.
2112+
2113+
2114+ .. confval :: strict_config
2115+
2116+ If set to ``True ``, any warnings encountered while parsing the ``pytest `` section of the configuration file will raise errors.
2117+
2118+ .. code-block :: ini
2119+
2120+ [pytest]
2121+ strict_config = True
2122+
2123+ You can also enable this option via the :confval: `strict ` option.
2124+
2125+
2126+ .. confval :: strict_markers
2127+
2128+ If set to ``True ``, markers not registered in the ``markers `` section of the configuration file will raise errors.
2129+
2130+ .. code-block :: ini
2131+
2132+ [pytest]
2133+ strict_markers = True
2134+
2135+ You can also enable this option via the :confval: `strict ` option.
2136+
20842137
20852138.. confval :: strict_parametrization_ids
20862139
@@ -2094,6 +2147,8 @@ passed multiple times. The expected format is ``name=value``. For example::
20942147 [pytest]
20952148 strict_parametrization_ids = True
20962149
2150+ You can also enable this option via the :confval: `strict ` option.
2151+
20972152 For example,
20982153
20992154 .. code-block :: python
0 commit comments