@@ -237,7 +237,7 @@ pytest.mark.xfail
237237
238238Marks a test function as *expected to fail *.
239239
240- .. py :function :: pytest.mark.xfail(condition = None , * , reason = None , raises = None , run = True , strict = False )
240+ .. py :function :: pytest.mark.xfail(condition = None , * , reason = None , raises = None , run = True , strict = xfail_strict )
241241
242242 :type condition: bool or str
243243 :param condition:
@@ -249,17 +249,19 @@ Marks a test function as *expected to fail*.
249249 :keyword Type[Exception] raises:
250250 Exception subclass (or tuple of subclasses) expected to be raised by the test function; other exceptions will fail the test.
251251 :keyword bool run:
252- If the test function should actually be executed. If ``False ``, the function will always xfail and will
252+ Whether the test function should actually be executed. If ``False ``, the function will always xfail and will
253253 not be executed (useful if a function is segfaulting).
254254 :keyword bool strict:
255- * If ``False `` (the default) the function will be shown in the terminal output as ``xfailed `` if it fails
255+ * If ``False `` the function will be shown in the terminal output as ``xfailed `` if it fails
256256 and as ``xpass `` if it passes. In both cases this will not cause the test suite to fail as a whole. This
257257 is particularly useful to mark *flaky * tests (tests that fail at random) to be tackled later.
258258 * If ``True ``, the function will be shown in the terminal output as ``xfailed `` if it fails, but if it
259259 unexpectedly passes then it will **fail ** the test suite. This is particularly useful to mark functions
260260 that are always failing and there should be a clear indication if they unexpectedly start to pass (for example
261261 a new release of a library fixes a known bug).
262262
263+ Defaults to :confval: `xfail_strict `, which is ``False `` by default.
264+
263265
264266Custom marks
265267~~~~~~~~~~~~
@@ -1638,11 +1640,11 @@ passed multiple times. The expected format is ``name=value``. For example::
16381640 Additionally, ``pytest `` will attempt to intelligently identify and ignore a
16391641 virtualenv by the presence of an activation script. Any directory deemed to
16401642 be the root of a virtual environment will not be considered during test
1641- collection unless ``‑‑ collect‑in‑ virtualenv `` is given. Note also that
1642- ``norecursedirs `` takes precedence over ``‑‑ collect‑in‑ virtualenv ``; e.g. if
1643+ collection unless ``-- collect-in- virtualenv `` is given. Note also that
1644+ ``norecursedirs `` takes precedence over ``-- collect-in- virtualenv ``; e.g. if
16431645 you intend to run tests in a virtualenv with a base directory that matches
16441646 ``'.*' `` you *must * override ``norecursedirs `` in addition to using the
1645- ``‑‑ collect‑in‑ virtualenv `` flag.
1647+ ``-- collect-in- virtualenv `` flag.
16461648
16471649
16481650.. confval :: python_classes
0 commit comments