Closed
Description
While https://docs.pytest.org/en/7.1.x/how-to/tmp_path.html#the-tmpdir-and-tmpdir-factory-fixtures` mentions "These days, prefer to use tmp_path and tmp_path_factory", it's quite hidden in the text.
I propose to announce this more loudly using a note admonition. Additionally the note admonition should be placed in the docstrings:
- https://docs.pytest.org/en/7.1.x/reference/reference.html?highlight=tmpdir#std-fixture-tmpdir
- https://docs.pytest.org/en/7.1.x/reference/reference.html?highlight=tmpdir#pytest.legacypath.LegacyTmpdirPlugin.tmpdir
The same holds for tmpdir_factory
.
Activity
nicoddemus commentedon May 10, 2022
Definitely @timhoffm, thanks!
vitaliyterziev commentedon May 15, 2022
Hello, I can help with that if not taken already, do you have any particular message you would like me to use for the notes under tmpdir function and TempdirFactory class and also for the docstrings in "pytest/blob/main/src/_pytest/legacypath.py"?
Improve tmp_path documentation pytest-dev#9937
DaniSancas commentedon Jul 15, 2022
Hi @timhoffm, from @clarityai-eng we'd like to contribute to the Pytest project by creating a PR to fix this issue.
We hope you find it useful, let us know if it fits your requirements.
Explicit note that tmpdir fixture is discouraged in favour of tmp_path …
[7.1.x] Explicit note that tmpdir fixture is discouraged in favour of…
Merge pull request #10140 from pytest-dev/backport-10138-to-7.1.x
Replace tmpdir with tmp_path pytest-dev/pytest#9937
chore(deps): update dependency pytest to v7 (#3)