Skip to content

Commit a28d595

Browse files
committed
doc: add note to help modernize code bases to use pathlib
Fixes #10199
1 parent 3c15349 commit a28d595

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/en/how-to/tmp_path.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ rather than standard :class:`pathlib.Path` objects.
109109
.. note::
110110
These days, it is preferred to use ``tmp_path`` and ``tmp_path_factory``.
111111

112+
In order to help modernize old code bases, one can run pytest with the legacypath
113+
plugin disabled:
114+
115+
.. code-block:: bash
116+
117+
pytest -p no:legacypath
118+
119+
This will trigger errors on tests using the legacy paths.
120+
It can also be permanently set as part of the :confval:`addopts` parameter in the
121+
config file.
122+
112123
See :fixture:`tmpdir <tmpdir>` :fixture:`tmpdir_factory <tmpdir_factory>`
113124
API for details.
114125

0 commit comments

Comments
 (0)