Merge pull request #4869 from nicoddemus/tmppath-docs
Add missing ref docs to tmp_path and tmp_path_factory
This commit is contained in:
commit
907e9495a2
|
@ -499,6 +499,32 @@ Each recorded warning is an instance of :class:`warnings.WarningMessage`.
|
||||||
differently; see :ref:`ensuring_function_triggers`.
|
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
|
tmpdir
|
||||||
~~~~~~
|
~~~~~~
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,9 @@ Running this would result in a passed test except for the last
|
||||||
test_tmp_path.py:13: AssertionError
|
test_tmp_path.py:13: AssertionError
|
||||||
========================= 1 failed in 0.12 seconds =========================
|
========================= 1 failed in 0.12 seconds =========================
|
||||||
|
|
||||||
|
|
||||||
|
.. _`tmp_path_factory example`:
|
||||||
|
|
||||||
The ``tmp_path_factory`` fixture
|
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.
|
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
|
The 'tmpdir' fixture
|
||||||
--------------------
|
--------------------
|
||||||
|
|
Loading…
Reference in New Issue