summaryrefslogtreecommitdiff
path: root/doc/en/skipping.rst
diff options
context:
space:
mode:
authorXuan Luong <luonghoaixuan@gmail.com>2017-10-05 20:14:45 -0400
committerXuan Luong <luonghoaixuan@gmail.com>2017-10-05 20:14:45 -0400
commit4bc6ecb8a50e30b04d83e141fd55e5c3c80faeb8 (patch)
tree22a7df693dcf6b11bb42a87388f2f29f66fad070 /doc/en/skipping.rst
parent9ee0a1f5c31102be63219812353536761e6b1aca (diff)
downloadpytest-4bc6ecb8a50e30b04d83e141fd55e5c3c80faeb8.tar.gz
Add mention of xpass in skip/xfail documentation
Diffstat (limited to 'doc/en/skipping.rst')
-rw-r--r--doc/en/skipping.rst12
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/en/skipping.rst b/doc/en/skipping.rst
index 1504c251c..f8cfb73ca 100644
--- a/doc/en/skipping.rst
+++ b/doc/en/skipping.rst
@@ -16,13 +16,17 @@ resource which is not available at the moment (for example a database).
A **xfail** means that you expect a test to fail for some reason.
A common example is a test for a feature not yet implemented, or a bug not yet fixed.
+When a test passes despite being expected to fail (marked with ``pytest.mark.xfail``),
+it's an **xpass** and will be reported in the test summary.
``pytest`` counts and lists *skip* and *xfail* tests separately. Detailed
information about skipped/xfailed tests is not shown by default to avoid
cluttering the output. You can use the ``-r`` option to see details
corresponding to the "short" letters shown in the test progress::
- pytest -rxs # show extra info on skips and xfails
+ pytest -rxXs # show extra info on xfailed, xpassed, and skipped tests
+
+More details on the ``-r`` option can be found by running ``pytest -h``.
(See :ref:`how to change command line options defaults`)
@@ -311,12 +315,12 @@ Running it with the report-on-xfail option gives this output::
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
rootdir: $REGENDOC_TMPDIR/example, inifile:
collected 7 items
-
+
xfail_demo.py xxxxxxx
======= short test summary info ========
XFAIL xfail_demo.py::test_hello
XFAIL xfail_demo.py::test_hello2
- reason: [NOTRUN]
+ reason: [NOTRUN]
XFAIL xfail_demo.py::test_hello3
condition: hasattr(os, 'sep')
XFAIL xfail_demo.py::test_hello4
@@ -326,7 +330,7 @@ Running it with the report-on-xfail option gives this output::
XFAIL xfail_demo.py::test_hello6
reason: reason
XFAIL xfail_demo.py::test_hello7
-
+
======= 7 xfailed in 0.12 seconds ========
.. _`skip/xfail with parametrize`: