Skip to content

Commit 907e949

Browse files
authored
Merge pull request #4869 from nicoddemus/tmppath-docs
Add missing ref docs to tmp_path and tmp_path_factory
2 parents 4290cac + dac164c commit 907e949

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

doc/en/reference.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,32 @@ Each recorded warning is an instance of :class:`warnings.WarningMessage`.
499499
differently; see :ref:`ensuring_function_triggers`.
500500

501501

502+
tmp_path
503+
~~~~~~~~
504+
505+
**Tutorial**: :doc:`tmpdir`
506+
507+
.. currentmodule:: _pytest.tmpdir
508+
509+
.. autofunction:: tmp_path()
510+
:no-auto-options:
511+
512+
513+
tmp_path_factory
514+
~~~~~~~~~~~~~~~~
515+
516+
**Tutorial**: :ref:`tmp_path_factory example`
517+
518+
.. _`tmp_path_factory factory api`:
519+
520+
``tmp_path_factory`` instances have the following methods:
521+
522+
.. currentmodule:: _pytest.tmpdir
523+
524+
.. automethod:: TempPathFactory.mktemp
525+
.. automethod:: TempPathFactory.getbasetemp
526+
527+
502528
tmpdir
503529
~~~~~~
504530

doc/en/tmpdir.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ Running this would result in a passed test except for the last
6666
test_tmp_path.py:13: AssertionError
6767
========================= 1 failed in 0.12 seconds =========================
6868
69+
70+
.. _`tmp_path_factory example`:
71+
6972
The ``tmp_path_factory`` fixture
7073
--------------------------------
7174

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

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

83+
See :ref:`tmp_path_factory API <tmp_path_factory factory api>` for details.
84+
8085

8186
The 'tmpdir' fixture
8287
--------------------

0 commit comments

Comments
 (0)