Skip to content

Commit

Permalink
Docs: Note lifetime of temporary directories
Browse files Browse the repository at this point in the history
Explanation: The default handling of these lifetimes is done in
`tmpdir.TempPathFactory.getbasetemp`, which passes `keep=3` to
`pathlib.make_numbered_dir_with_cleanup`.

GH Issue: pytest-dev#8036
  • Loading branch information
matthewhughes934 committed Nov 28, 2020
1 parent 3405c7e commit 6a25660
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/_pytest/tmpdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ def tmpdir(tmp_path: Path) -> py.path.local:
function invocation, created as a sub directory of the base temporary
directory.
By default, a new base temporary directory is created each test session,
and old bases are removed after 3 sessions, to aid in debugging. If
``--basetemp`` is used then it is cleared each session. See :ref:`base
temporary directory`.
The returned object is a `py.path.local`_ path object.
.. _`py.path.local`: https://py.readthedocs.io/en/latest/path.html
Expand All @@ -187,6 +192,11 @@ def tmp_path(request: FixtureRequest, tmp_path_factory: TempPathFactory) -> Path
function invocation, created as a sub directory of the base temporary
directory.
By default, a new base temporary directory is created each test session,
and old bases are removed after 3 sessions, to aid in debugging. If
``--basetemp`` is used then it is cleared each session. See :ref:`base
temporary directory`.
The returned object is a :class:`pathlib.Path` object.
"""

Expand Down

0 comments on commit 6a25660

Please sign in to comment.