fix and test "-rP" option to show xpass-test ids

--HG--
branch : trunk
This commit is contained in:
holger krekel 2010-05-19 16:52:03 +02:00
parent 2229d2d947
commit 20424a9c76
2 changed files with 22 additions and 1 deletions

View File

@ -234,7 +234,7 @@ def pytest_terminal_summary(terminalreporter):
for char in tr.reportchars: for char in tr.reportchars:
if char == "x": if char == "x":
show_xfailed(terminalreporter, lines) show_xfailed(terminalreporter, lines)
elif char == "X": elif char == "P":
show_xpassed(terminalreporter, lines) show_xpassed(terminalreporter, lines)
elif char == "f": elif char == "f":
show_failed(terminalreporter, lines) show_failed(terminalreporter, lines)

View File

@ -280,3 +280,24 @@ def test_skipped_reasons_functional(testdir):
]) ])
assert result.ret == 0 assert result.ret == 0
def test_reportchars(testdir):
testdir.makepyfile("""
import py
def test_1():
assert 0
@py.test.mark.xfail
def test_2():
assert 0
@py.test.mark.xfail
def test_3():
pass
def test_4():
py.test.skip("four")
""")
result = testdir.runpytest("-rfxPs")
result.stdout.fnmatch_lines([
"FAIL*test_1*",
"XFAIL*test_2*",
"XPASS*test_3*",
"SKIP*four*",
])