Skip to content

T3566,T3546: added a blurb in usage.rst for usage of flag -r #3917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Christian Theunert
Christian Tismer
Christopher Gilling
Cyrus Maden
Dhiren Serai
Daniel Grana
Daniel Hahler
Daniel Nuri
Expand Down
1 change: 1 addition & 0 deletions changelog/3566.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added a blurb in usage.rst for the usage of -r flag which is used to show an extra test summary info.
2 changes: 1 addition & 1 deletion doc/en/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"python": ("http://docs.python.org/3", None)}
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}


def setup(app):
Expand Down
42 changes: 42 additions & 0 deletions doc/en/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,48 @@ will be shown (because KeyboardInterrupt is caught by pytest). By using this
option you make sure a trace is shown.


.. _`pytest.detailed_failed_tests_usage`:

Detailed summary report
-----------------------

.. versionadded:: 2.9

The ``-r`` flag can be used to display test results summary at the end of the test session,
making it easy in large test suites to get a clear picture of all failures, skips, xfails, etc.

Example::

$ pytest -ra
======================== test session starts ========================
...
====================== short test summary info ======================
FAIL summary\test_foo.py::test_1
SKIP [1] summary\test_foo.py:12: not supported in this platform
XPASS summary\test_bar.py::test_4 flaky

===== 1 failed, 1 passed, 1 skipped, 1 xpassed in 0.08 seconds ======


The ``-r`` options accepts a number of characters after it, with ``a`` used above meaning "all except passes".

Here is the full list of available characters that can be used:

- ``f`` - failed
- ``E`` - error
- ``s`` - skipped
- ``x`` - xfailed
- ``X`` - xpassed
- ``p`` - passed
- ``P`` - passed with output
- ``a`` - all except ``pP``

More than one character can be used, so for example to only see failed and skipped tests, you can execute::

$ pytest -rfs



.. _pdb-option:

Dropping to PDB_ (Python Debugger) on failures
Expand Down