Imperatively xfail an executing test or setup function with the given reason. This function should be called only during testing (setup, call or teardown). .. note:: It is better to use the :ref:`pytest.mark.xfail ref` marker when possible to declare a test to be xfailed un
(reason: str = "")
| 239 | |
| 240 | @_with_exception(XFailed) |
| 241 | def xfail(reason: str = "") -> "NoReturn": |
| 242 | """Imperatively xfail an executing test or setup function with the given reason. |
| 243 | |
| 244 | This function should be called only during testing (setup, call or teardown). |
| 245 | |
| 246 | .. note:: |
| 247 | It is better to use the :ref:`pytest.mark.xfail ref` marker when |
| 248 | possible to declare a test to be xfailed under certain conditions |
| 249 | like known bugs or missing features. |
| 250 | """ |
| 251 | __tracebackhide__ = True |
| 252 | raise XFailed(reason) |
| 253 | |
| 254 | |
| 255 | def importorskip( |