summaryrefslogtreecommitdiff
path: root/_pytest
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2013-10-09 22:55:20 +0200
committerholger krekel <holger@merlinux.eu>2013-10-09 22:55:20 +0200
commita5d4c2090581cbbdda641cd1b9cf9d2615b37534 (patch)
tree91c1fdbb290442cb51bbcc3832af1063ea6704bd /_pytest
parent0335c6d7509daa16c174a02d864479b44356d8ce (diff)
downloadpytest-a5d4c2090581cbbdda641cd1b9cf9d2615b37534.tar.gz
make "--runxfail" turn imperative pytest.xfail calls into no ops
(it already did neutralize pytest.mark.xfail markers)
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/skipping.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/_pytest/skipping.py b/_pytest/skipping.py
index d691d9fd8..f6915d431 100644
--- a/_pytest/skipping.py
+++ b/_pytest/skipping.py
@@ -10,6 +10,14 @@ def pytest_addoption(parser):
help="run tests even if they are marked xfail")
def pytest_configure(config):
+ if config.option.runxfail:
+ old = pytest.xfail
+ config._cleanup.append(lambda: setattr(pytest, "xfail", old))
+ def nop(*args, **kwargs):
+ pass
+ nop.Exception = XFailed
+ setattr(pytest, "xfail", nop)
+
config.addinivalue_line("markers",
"skipif(condition): skip the given test function if eval(condition) "
"results in a True value. Evaluation happens within the "