From 11022e1d352b275aaa41008692be4bac6d90ac29 Mon Sep 17 00:00:00 2001 From: Emily Mamcarz Date: Sat, 29 Nov 2025 20:31:59 -0500 Subject: [PATCH 1/2] Fix subtests documentation highlighting: remove misleading all-green 'u' output --- AUTHORS | 1 + doc/en/how-to/subtests.rst | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/AUTHORS b/AUTHORS index a089ca678f7..5f70e0df180 100644 --- a/AUTHORS +++ b/AUTHORS @@ -151,6 +151,7 @@ Eli Boyarski Elizaveta Shashkova Éloi Rivard Emil Hjelm +Emily Mamcarz Endre Galaczi Eric Hunsberger Eric Liu diff --git a/doc/en/how-to/subtests.rst b/doc/en/how-to/subtests.rst index 5a08dbc4769..0312424332a 100644 --- a/doc/en/how-to/subtests.rst +++ b/doc/en/how-to/subtests.rst @@ -26,10 +26,10 @@ Subtests are an alternative to parametrization, particularly useful when the exa Each assertion failure or error is caught by the context manager and reported individually: -.. code-block:: pytest +.. code-block:: console $ pytest -q test_subtest.py - uuuuuF [100%] + u u u u uF [100%] ================================= FAILURES ================================= _______________________ test [custom message] (i=1) ________________________ @@ -61,14 +61,6 @@ Each assertion failure or error is caught by the context manager and reported in FAILED test_subtest.py::test - contains 2 failed subtests 3 failed, 3 subtests passed in 0.12s -In the output above: - -* Subtest failures are reported as ``SUBFAILED``. -* Subtests are reported first and the "top-level" test is reported at the end on its own. - -Note that it is possible to use ``subtests`` multiple times in the same test, or even mix and match with normal assertions -outside the ``subtests.test`` block: - .. code-block:: python def test(subtests): From 8224036ab55f867d2c792d776fd52e96f6e3c491 Mon Sep 17 00:00:00 2001 From: Emily Mamcarz Date: Sat, 29 Nov 2025 20:46:37 -0500 Subject: [PATCH 2/2] docs: restore accidentally removed subtest output explanation --- doc/en/how-to/subtests.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/en/how-to/subtests.rst b/doc/en/how-to/subtests.rst index 0312424332a..c01b79fbca3 100644 --- a/doc/en/how-to/subtests.rst +++ b/doc/en/how-to/subtests.rst @@ -61,6 +61,14 @@ Each assertion failure or error is caught by the context manager and reported in FAILED test_subtest.py::test - contains 2 failed subtests 3 failed, 3 subtests passed in 0.12s +In the output above: + +* Subtest failures are reported as ``SUBFAILED``. +* Subtests are reported first and the "top-level" test is reported at the end on its own. + +Note that it is possible to use ``subtests`` multiple times in the same test, or even mix and match with normal assertions +outside the ``subtests.test`` block: + .. code-block:: python def test(subtests):