From 95881c870e80a537812e6e4fefb3da97925073b6 Mon Sep 17 00:00:00 2001 From: dhirensr Date: Fri, 31 Aug 2018 11:20:15 +0530 Subject: [PATCH] T3566,T3546: added a blurb in usage.rst for usage of flag -r --- AUTHORS | 1 + changelog/3566.doc.rst | 1 + doc/en/usage.rst | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 changelog/3566.doc.rst diff --git a/AUTHORS b/AUTHORS index 1641ea15e..c39c0c68a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -47,6 +47,7 @@ Christian Theunert Christian Tismer Christopher Gilling Cyrus Maden +Dhiren Serai Daniel Grana Daniel Hahler Daniel Nuri diff --git a/changelog/3566.doc.rst b/changelog/3566.doc.rst new file mode 100644 index 000000000..d8eda4241 --- /dev/null +++ b/changelog/3566.doc.rst @@ -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. diff --git a/doc/en/usage.rst b/doc/en/usage.rst index a5418df22..9cc29c774 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -527,3 +527,40 @@ hook was invoked:: .. include:: links.inc + +.. _`pytest.detailed_failed_tests_usage`: + +Detailed Summary Report of Failed,Skipped,xfailed tests +-------------------------------------------------------- + +.. versionadded:: 2.9 + +When there are more than 200 tests in a file and pytest is run and many tests are failing,then it is difficult to find which tests +are failing and the person just doesn't wants to scroll and see each and every failed test. + + +This way the failed test can be missed,so pytest has a flag known as -r to denote the failed,skipped,xfailed tests. + +To create an extra summary report at the end of the output, use this invocation:: + + python -r chars + +where chars are : + - (f)ailed, + - (E)error, + - (s)skipped, + - (x)failed, + - (X)passed, + - (p)passed, + - (P)passed with output, + - (a)all except pP. + +**Examples:** + +- To show extra info on xfailed, xpassed, and skipped tests:: + + pytest -r xXs + +- To show extra info on all tests except (p)assed and (P)assed with output ,this is the most commonly used command:: + + pytest -r a