Skip to content

Commit 19c3c82

Browse files
authored
Merge pull request #13962 from pytest-dev/patchback/backports/9.0.x/9652bc714d0cae7f849d285aaa9f5a7e42e89ee3/pr-13958
[PR #13958/9652bc71 backport][9.0.x] doc: fix TOML example for `tmp_path_retention_count`, it's a string
2 parents 50f74bb + 327766c commit 19c3c82

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
@@ -2460,14 +2460,14 @@ passed multiple times. The expected format is ``name=value``. For example::
24602460
.. confval:: tmp_path_retention_count
24612461

24622462
How many sessions should we keep the `tmp_path` directories,
2463-
according to `tmp_path_retention_policy`.
2463+
according to :confval:`tmp_path_retention_policy`.
24642464

24652465
.. tab:: toml
24662466

24672467
.. code-block:: toml
24682468
24692469
[pytest]
2470-
tmp_path_retention_count = 3
2470+
tmp_path_retention_count = "3"
24712471
24722472
.. tab:: ini
24732473

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)