Skip to content

Explicit note that tmpdir fixture is discouraged in favour of tmp_path #9937

Closed
@timhoffm

Description

@timhoffm

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:

The same holds for tmpdir_factory.

Activity

added
type: docsdocumentation improvement, missing or needing clarification
good first issueeasy issue that is friendly to new contributor
on May 10, 2022
nicoddemus

nicoddemus commented on May 10, 2022

@nicoddemus
Member

Definitely @timhoffm, thanks!

vitaliyterziev

vitaliyterziev commented on May 15, 2022

@vitaliyterziev

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"?

DaniSancas

DaniSancas commented on Jul 15, 2022

@DaniSancas
Contributor

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.

added a commit that references this issue on Jul 15, 2022

Merge pull request #10140 from pytest-dev/backport-10138-to-7.1.x

121b692
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @nicoddemus@timhoffm@DaniSancas@vitaliyterziev

      Issue actions

        Explicit note that tmpdir fixture is discouraged in favour of tmp_path · Issue #9937 · pytest-dev/pytest