From 1181384493aa0dc8875bd8ef5aa53158afded699 Mon Sep 17 00:00:00 2001 From: Patrick Lannigan Date: Sat, 25 Nov 2023 15:22:57 -0500 Subject: [PATCH] Add documentaiton & changelog entry --- changelog/11639.feature.rst | 5 +++++ doc/en/how-to/output.rst | 4 +++- doc/en/reference/reference.rst | 13 +++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 changelog/11639.feature.rst diff --git a/changelog/11639.feature.rst b/changelog/11639.feature.rst new file mode 100644 index 000000000..2c83f798b --- /dev/null +++ b/changelog/11639.feature.rst @@ -0,0 +1,5 @@ +Added the new :confval:`verbosity_test_case` configuration option for fine-grained control of failed assertions verbosity. + +See :ref:`Fine-grained verbosity ` for more details. + +For plugin authors, :attr:`config.get_verbosity ` can be used to retrieve the verbosity level for a specific verbosity type. diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index 8af9a38b7..d24e98f9b 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -298,7 +298,9 @@ This is done by setting a verbosity level in the configuration file for the spec ``pytest --no-header`` with a value of ``2`` would have the same output as the previous example, but each test inside the file is shown by a single character in the output. -(Note: currently this is the only option available, but more might be added in the future). +:confval:`verbosity_test_case`: Controls how verbose the test execution output should be when pytest is executed. +Running ``pytest --no-header`` with a value of ``2`` would have the same output as the first verbosity example, but each +test inside the file gets its own line in the output. .. _`pytest.detailed_failed_tests_usage`: diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 254973709..4d5e1b381 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1835,6 +1835,19 @@ passed multiple times. The expected format is ``name=value``. For example:: "auto" can be used to explicitly use the global verbosity level. +.. confval:: verbosity_test_case + + Set a verbosity level specifically for test case execution related output, overriding the application wide level. + + .. code-block:: ini + + [pytest] + verbosity_test_case = 2 + + Defaults to application wide verbosity level (via the ``-v`` command-line option). A special value of + "auto" can be used to explicitly use the global verbosity level. + + .. confval:: xfail_strict If set to ``True``, tests marked with ``@pytest.mark.xfail`` that actually succeed will by default fail the