Skip to content

Commit 9652bc7

Browse files
authored
Merge pull request #13958 from bluetech/fix-tmpdir-retention-toml
doc: fix TOML example for `tmp_path_retention_count`, it's a string
2 parents 90b9389 + 2e34924 commit 9652bc7

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

changelog/13904.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed the TOML type of the :confval:`tmp_path_retention_count` settings in the API reference from number to string.

doc/en/reference/reference.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,14 +2465,14 @@ passed multiple times. The expected format is ``name=value``. For example::
24652465
.. confval:: tmp_path_retention_count
24662466

24672467
How many sessions should we keep the `tmp_path` directories,
2468-
according to `tmp_path_retention_policy`.
2468+
according to :confval:`tmp_path_retention_policy`.
24692469

24702470
.. tab:: toml
24712471

24722472
.. code-block:: toml
24732473
24742474
[pytest]
2475-
tmp_path_retention_count = 3
2475+
tmp_path_retention_count = "3"
24762476
24772477
.. tab:: ini
24782478

src/_pytest/tmpdir.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,16 @@ def pytest_addoption(parser: Parser) -> None:
225225
parser.addini(
226226
"tmp_path_retention_count",
227227
help="How many sessions should we keep the `tmp_path` directories, according to `tmp_path_retention_policy`.",
228-
default=3,
228+
default="3",
229+
# NOTE: Would have been better as an `int` but can't change it now.
230+
type="string",
229231
)
230232

231233
parser.addini(
232234
"tmp_path_retention_policy",
233235
help="Controls which directories created by the `tmp_path` fixture are kept around, based on test outcome. "
234236
"(all/failed/none)",
237+
type="string",
235238
default="all",
236239
)
237240

0 commit comments

Comments
 (0)