newlines
This commit is contained in:
parent
9e57954b03
commit
213dbe7a5f
|
@ -7,12 +7,14 @@ import py
|
|||
import pytest
|
||||
from _pytest.mark import MarkInfo
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
group = parser.getgroup("general")
|
||||
group.addoption('--runxfail',
|
||||
action="store_true", dest="runxfail", default=False,
|
||||
help="run tests even if they are marked xfail")
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
if config.option.runxfail:
|
||||
old = pytest.xfail
|
||||
|
@ -39,18 +41,22 @@ def pytest_configure(config):
|
|||
"See http://pytest.org/latest/skipping.html"
|
||||
)
|
||||
|
||||
|
||||
def pytest_namespace():
|
||||
return dict(xfail=xfail)
|
||||
|
||||
|
||||
class XFailed(pytest.fail.Exception):
|
||||
""" raised from an explicit call to pytest.xfail() """
|
||||
|
||||
|
||||
def xfail(reason=""):
|
||||
""" xfail an executing test or setup functions with the given reason."""
|
||||
__tracebackhide__ = True
|
||||
raise XFailed(reason)
|
||||
xfail.Exception = XFailed
|
||||
|
||||
|
||||
class MarkEvaluator(object):
|
||||
def __init__(self, item, name):
|
||||
self.item = item
|
||||
|
|
|
@ -4,6 +4,7 @@ import sys
|
|||
from _pytest.skipping import MarkEvaluator, folded_skips, pytest_runtest_setup
|
||||
from _pytest.runner import runtestprotocol
|
||||
|
||||
|
||||
class TestEvaluator(object):
|
||||
def test_no_marker(self, testdir):
|
||||
item = testdir.getitem("def test_func(): pass")
|
||||
|
|
Loading…
Reference in New Issue