@@ -237,7 +237,7 @@ pytest.mark.xfail
237
237
238
238
Marks a test function as *expected to fail *.
239
239
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 )
241
241
242
242
:type condition: bool or str
243
243
:param condition:
@@ -249,17 +249,19 @@ Marks a test function as *expected to fail*.
249
249
:keyword Type[Exception] raises:
250
250
Exception subclass (or tuple of subclasses) expected to be raised by the test function; other exceptions will fail the test.
251
251
: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
253
253
not be executed (useful if a function is segfaulting).
254
254
: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
256
256
and as ``xpass `` if it passes. In both cases this will not cause the test suite to fail as a whole. This
257
257
is particularly useful to mark *flaky * tests (tests that fail at random) to be tackled later.
258
258
* If ``True ``, the function will be shown in the terminal output as ``xfailed `` if it fails, but if it
259
259
unexpectedly passes then it will **fail ** the test suite. This is particularly useful to mark functions
260
260
that are always failing and there should be a clear indication if they unexpectedly start to pass (for example
261
261
a new release of a library fixes a known bug).
262
262
263
+ Defaults to :confval: `xfail_strict `, which is ``False `` by default.
264
+
263
265
264
266
Custom marks
265
267
~~~~~~~~~~~~
0 commit comments