Skip to content

Add missing ref docs to tmp_path and tmp_path_factory #4869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2019
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