Skip to content

Commit 495b441

Browse files
authored
Merge pull request #3917 from dhirensr/docs_for_detailed_info
T3566,T3546: added a blurb in usage.rst for usage of flag -r
2 parents 8d8e68c + f3b0caf commit 495b441

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Christian Theunert
4747
Christian Tismer
4848
Christopher Gilling
4949
Cyrus Maden
50+
Dhiren Serai
5051
Daniel Grana
5152
Daniel Hahler
5253
Daniel Nuri

changelog/3566.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added a blurb in usage.rst for the usage of -r flag which is used to show an extra test summary info.

doc/en/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329

330330

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

334334

335335
def setup(app):

doc/en/usage.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,48 @@ will be shown (because KeyboardInterrupt is caught by pytest). By using this
140140
option you make sure a trace is shown.
141141

142142

143+
.. _`pytest.detailed_failed_tests_usage`:
144+
145+
Detailed summary report
146+
-----------------------
147+
148+
.. versionadded:: 2.9
149+
150+
The ``-r`` flag can be used to display test results summary at the end of the test session,
151+
making it easy in large test suites to get a clear picture of all failures, skips, xfails, etc.
152+
153+
Example::
154+
155+
$ pytest -ra
156+
======================== test session starts ========================
157+
...
158+
====================== short test summary info ======================
159+
FAIL summary\test_foo.py::test_1
160+
SKIP [1] summary\test_foo.py:12: not supported in this platform
161+
XPASS summary\test_bar.py::test_4 flaky
162+
163+
===== 1 failed, 1 passed, 1 skipped, 1 xpassed in 0.08 seconds ======
164+
165+
166+
The ``-r`` options accepts a number of characters after it, with ``a`` used above meaning "all except passes".
167+
168+
Here is the full list of available characters that can be used:
169+
170+
- ``f`` - failed
171+
- ``E`` - error
172+
- ``s`` - skipped
173+
- ``x`` - xfailed
174+
- ``X`` - xpassed
175+
- ``p`` - passed
176+
- ``P`` - passed with output
177+
- ``a`` - all except ``pP``
178+
179+
More than one character can be used, so for example to only see failed and skipped tests, you can execute::
180+
181+
$ pytest -rfs
182+
183+
184+
143185
.. _pdb-option:
144186

145187
Dropping to PDB_ (Python Debugger) on failures

0 commit comments

Comments
 (0)