Merge pull request #4869 from nicoddemus/tmppath-docs

Add missing ref docs to tmp_path and tmp_path_factory
This commit is contained in:
Bruno Oliveira 2019-03-01 17:22:14 -03:00 committed by GitHub
commit 907e9495a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -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
~~~~~~

View File

@ -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
--------------------------------
@ -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
--------------------