From 7cba3a07afc43b2c23940f5692780973aa3fc1a6 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 21 May 2010 18:16:16 +0200 Subject: [PATCH] update docs: mention that py.test.xfail is there --HG-- branch : trunk --- py/_plugin/pytest_skipping.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/py/_plugin/pytest_skipping.py b/py/_plugin/pytest_skipping.py index 6ea3154df..915238f94 100644 --- a/py/_plugin/pytest_skipping.py +++ b/py/_plugin/pytest_skipping.py @@ -106,6 +106,17 @@ To specify an explicit reason to be shown with xfailure detail:: @py.test.mark.xfail(..., reason="my reason") +imperative xfail from within a test or setup function +------------------------------------------------------ + +If you cannot declare xfail-conditions at import time +you can also imperatively produce an XFail-outcome from +within test or setup code. Example:: + + def test_function(): + if not valid_config(): + py.test.xfail("unsuppored configuration") + skipping on a missing import dependency --------------------------------------------------