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
26 changes: 26 additions & 0 deletions doc/en/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,32 @@ Each recorded warning is an instance of :class:`warnings.WarningMessage`.
differently; see :ref:`ensuring_function_triggers`.


tmp_path
~~~~~~~~

**Tutorial**: :doc:`tmpdir`

.. currentmodule:: _pytest.tmpdir

.. autofunction:: tmp_path()
:no-auto-options:


tmp_path_factory
~~~~~~~~~~~~~~~~

**Tutorial**: :ref:`tmp_path_factory example`

.. _`tmp_path_factory factory api`:

``tmp_path_factory`` instances have the following methods:

.. currentmodule:: _pytest.tmpdir

.. automethod:: TempPathFactory.mktemp
.. automethod:: TempPathFactory.getbasetemp


tmpdir
~~~~~~

Expand Down
5 changes: 5 additions & 0 deletions doc/en/tmpdir.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ Running this would result in a passed test except for the last
test_tmp_path.py:13: AssertionError
========================= 1 failed in 0.12 seconds =========================


.. _`tmp_path_factory example`:

The ``tmp_path_factory`` fixture
--------------------------------

Expand All @@ -77,6 +80,8 @@ to create arbitrary temporary directories from any other fixture or test.

It is intended to replace ``tmpdir_factory``, and returns :class:`pathlib.Path` instances.

See :ref:`tmp_path_factory API <tmp_path_factory factory api>` for details.


The 'tmpdir' fixture
--------------------
Expand Down