Skip to content
Merged
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
1 change: 1 addition & 0 deletions changelog/13904.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed the TOML type of the :confval:`tmp_path_retention_count` settings in the API reference from number to string.
4 changes: 2 additions & 2 deletions doc/en/reference/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2460,14 +2460,14 @@ 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,
according to `tmp_path_retention_policy`.
according to :confval:`tmp_path_retention_policy`.

.. tab:: toml

.. code-block:: toml

[pytest]
tmp_path_retention_count = 3
tmp_path_retention_count = "3"

.. tab:: ini

Expand Down
5 changes: 4 additions & 1 deletion src/_pytest/tmpdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,16 @@ def pytest_addoption(parser: Parser) -> None:
parser.addini(
"tmp_path_retention_count",
help="How many sessions should we keep the `tmp_path` directories, according to `tmp_path_retention_policy`.",
default=3,
default="3",
# NOTE: Would have been better as an `int` but can't change it now.
type="string",
)

parser.addini(
"tmp_path_retention_policy",
help="Controls which directories created by the `tmp_path` fixture are kept around, based on test outcome. "
"(all/failed/none)",
type="string",
default="all",
)

Expand Down