Merge pull request #10331 from sgaist/add_modernization_tip_for_tmpdir_and_tmpdir_factory
This commit is contained in:
commit
784ba85b17
|
@ -109,6 +109,17 @@ rather than standard :class:`pathlib.Path` objects.
|
||||||
.. note::
|
.. note::
|
||||||
These days, it is preferred to use ``tmp_path`` and ``tmp_path_factory``.
|
These days, it is preferred to use ``tmp_path`` and ``tmp_path_factory``.
|
||||||
|
|
||||||
|
In order to help modernize old code bases, one can run pytest with the legacypath
|
||||||
|
plugin disabled:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pytest -p no:legacypath
|
||||||
|
|
||||||
|
This will trigger errors on tests using the legacy paths.
|
||||||
|
It can also be permanently set as part of the :confval:`addopts` parameter in the
|
||||||
|
config file.
|
||||||
|
|
||||||
See :fixture:`tmpdir <tmpdir>` :fixture:`tmpdir_factory <tmpdir_factory>`
|
See :fixture:`tmpdir <tmpdir>` :fixture:`tmpdir_factory <tmpdir_factory>`
|
||||||
API for details.
|
API for details.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue