Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/14180.doc.rst
Original file line number Diff line number Diff line change
@@ -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`.
8 changes: 4 additions & 4 deletions doc/en/reference/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down