diff options
Diffstat (limited to '_pytest/skipping.py')
-rw-r--r-- | _pytest/skipping.py | 8 |
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 " |