diff options
author | Ran Benita <ran@unusedvar.com> | 2020-12-05 21:54:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-05 21:54:04 +0200 |
commit | 1a1bb6134093b66541bafce28ed74a9c7559ba78 (patch) | |
tree | 20f31014597287fb752398aa9931e886b7065587 /src/_pytest | |
parent | e398c93884f228c9808adf9d0be2f876719e703d (diff) | |
parent | 6a256606c65e716b9457c50d700d93eaf2b383ca (diff) | |
download | pytest-1a1bb6134093b66541bafce28ed74a9c7559ba78.tar.gz |
Merge pull request #8038 from matthewhughes934/note-tmpdir-lifetime
Docs: Note lifetime of temporary directories
Diffstat (limited to 'src/_pytest')
-rw-r--r-- | src/_pytest/tmpdir.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index e62d08db5..08c445e2b 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -199,6 +199,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 @@ -212,6 +217,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. """ |