new --runxfail option to ignore xfail markers on functions

--HG--
branch : trunk
This commit is contained in:
holger krekel
2010-05-04 13:02:27 +02:00
parent 28150c7486
commit c933ada7fb
3 changed files with 30 additions and 7 deletions

View File

@@ -96,6 +96,21 @@ class TestXFail:
expl = callreport.keywords['xfail']
assert expl == "condition: True"
def test_xfail_run_anyway(self, testdir):
testdir.makepyfile("""
import py
@py.test.mark.xfail
def test_func():
assert 0
""")
result = testdir.runpytest("--runxfail")
assert result.ret == 1
result.stdout.fnmatch_lines([
"*def test_func():*",
"*assert 0*",
"*1 failed*",
])
def test_xfail_evalfalse_but_fails(self, testdir):
item = testdir.getitem("""
import py