diff --git a/py/_plugin/pytest_skipping.py b/py/_plugin/pytest_skipping.py index 397f29b8e..1651addd7 100644 --- a/py/_plugin/pytest_skipping.py +++ b/py/_plugin/pytest_skipping.py @@ -234,7 +234,7 @@ def pytest_terminal_summary(terminalreporter): for char in tr.reportchars: if char == "x": show_xfailed(terminalreporter, lines) - elif char == "X": + elif char == "P": show_xpassed(terminalreporter, lines) elif char == "f": show_failed(terminalreporter, lines) diff --git a/testing/plugin/test_pytest_skipping.py b/testing/plugin/test_pytest_skipping.py index f0e72d8c8..a94bacdef 100644 --- a/testing/plugin/test_pytest_skipping.py +++ b/testing/plugin/test_pytest_skipping.py @@ -280,3 +280,24 @@ def test_skipped_reasons_functional(testdir): ]) 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*", + ])