From edcd32768dc304c44308f71d0f50496908297a22 Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Wed, 11 Feb 2026 09:41:49 +0100 Subject: [PATCH 1/3] Clarify retention policy Document that `failed`` removes the files of passing tests in the teardown step but `none` only removes the files of tests at the end of the test session. --- doc/en/reference/reference.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 62ae3564e18..2d36567d02f 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -2493,8 +2493,8 @@ passed multiple times. The expected format is ``name=value``. For example:: based on test outcome. * `all`: retains directories for all tests, regardless of the outcome. - * `failed`: retains directories only for tests with outcome `error` or `failed`. - * `none`: directories are always removed after each test ends, regardless of the outcome. + * `failed`: retains directories only for tests with outcome `error` or `failed`. Non-retained directories are removed during teardown of the tmp_path fixture. + * `none`: directories are always removed after each test session ends, regardless of the outcome. .. tab:: toml From 2fdf8c44baf53216e3923137b03a2b08ab5ecaaf Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Wed, 11 Feb 2026 10:11:01 +0100 Subject: [PATCH 2/3] Cross link tmp_path fixture --- doc/en/reference/reference.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 2d36567d02f..6238d3a7293 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -2465,7 +2465,7 @@ passed multiple times. The expected format is ``name=value``. For example:: .. confval:: tmp_path_retention_count - How many sessions should we keep the `tmp_path` directories, + How many sessions should we keep the :fixture:`tmp_path` directories, according to :confval:`tmp_path_retention_policy`. .. tab:: toml @@ -2489,11 +2489,11 @@ passed multiple times. The expected format is ``name=value``. For example:: - Controls which directories created by the `tmp_path` fixture are kept around, + Controls which directories created by the :fixture:`tmp_path` fixture are kept around, based on test outcome. * `all`: retains directories for all tests, regardless of the outcome. - * `failed`: retains directories only for tests with outcome `error` or `failed`. Non-retained directories are removed during teardown of the tmp_path fixture. + * `failed`: retains directories only for tests with outcome `error` or `failed`. Non-retained directories are removed during teardown of the :fixture:`tmp_path` fixture. * `none`: directories are always removed after each test session ends, regardless of the outcome. .. tab:: toml From a5cdffaacf725a5f03ec84dd5a2a5349e1aa631e Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Wed, 11 Feb 2026 09:55:16 +0100 Subject: [PATCH 3/3] Add changelog for 14180 --- changelog/14180.doc.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelog/14180.doc.rst diff --git a/changelog/14180.doc.rst b/changelog/14180.doc.rst new file mode 100644 index 00000000000..e4b59348f7c --- /dev/null +++ b/changelog/14180.doc.rst @@ -0,0 +1,2 @@ +Clarify :confval:`tmp_path_retention_policy` by documenting that `failed` removes the files of passing tests in the teardown +step but `none` only removes the files of tests at the end of the test session -- by :user:`jenshnielsen`.