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`. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 62ae3564e18..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,12 +2489,12 @@ 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`. - * `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 :fixture:`tmp_path` fixture. + * `none`: directories are always removed after each test session ends, regardless of the outcome. .. tab:: toml