Add MarkEvaluator for skip
This commit is contained in:
parent
cb58eaa611
commit
b71add27da
|
@ -147,10 +147,16 @@ class MarkEvaluator:
|
||||||
|
|
||||||
@pytest.hookimpl(tryfirst=True)
|
@pytest.hookimpl(tryfirst=True)
|
||||||
def pytest_runtest_setup(item):
|
def pytest_runtest_setup(item):
|
||||||
evalskip = MarkEvaluator(item, 'skipif')
|
eval_skipif = MarkEvaluator(item, 'skipif')
|
||||||
if evalskip.istrue():
|
eval_skip = MarkEvaluator(item, 'skip')
|
||||||
item._evalskip = evalskip
|
|
||||||
pytest.skip(evalskip.getexplanation())
|
if eval_skipif.istrue():
|
||||||
|
item._evalskip = eval_skipif
|
||||||
|
pytest.skip(eval_skipif.getexplanation())
|
||||||
|
elif eval_skip.istrue():
|
||||||
|
item._evalskip = eval_skip
|
||||||
|
pytest.skip(eval_skip.getexplanation())
|
||||||
|
|
||||||
item._evalxfail = MarkEvaluator(item, 'xfail')
|
item._evalxfail = MarkEvaluator(item, 'xfail')
|
||||||
check_xfail_no_run(item)
|
check_xfail_no_run(item)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue