diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 1ed5d91b1..7ab734075 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -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 ~~~~~~ diff --git a/doc/en/tmpdir.rst b/doc/en/tmpdir.rst index df490d7fb..e2b8fc32b 100644 --- a/doc/en/tmpdir.rst +++ b/doc/en/tmpdir.rst @@ -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 ` for details. + The 'tmpdir' fixture --------------------