-
Notifications
You must be signed in to change notification settings - Fork 91
Description
tmp_pathis a modern replacement fortmpdir, by the way.
Thanks and noted.
From the pytest docs (https://docs.pytest.org/en/7.1.x/how-to/tmp_path.html#the-tmpdir-and-tmpdir-factory-fixtures):
The
tmpdirandtmpdir_factoryfixtures are similar totmp_pathandtmp_path_factory, but use/return legacypy.path.localobjects rather than standardpathlib.Pathobjects.Note
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:
pytest -p no:legacypathThis will trigger errors on tests using the legacy paths. It can also be permanently set as part of the addopts parameter in the config file.
We'll fix this up in another PR. 👍
Originally posted by @matthewfeickert in #2363 (comment) given feedback from @henryiii