Skip to content

TST: Replace ensure_clean utility function with the temp_file pytest fixture #62435

@mroeschke

Description

@mroeschke

The pandas test suite uses an ensure_clean utility function to create a temporary file for testing

def ensure_clean(filename=None) -> Generator[Any]:

This utility should be largely redundant with the temp_file pytest fixture

def temp_file(tmp_path):

Since there are about ~180 occurrences of ensure_clean in the code base, this issue should be completed in multiple PRs that replaces ensure_clean with temp_file in a particular file. Therefore, this issue can be worked on by multiple contributors.

For those interested in working on this issue:

  1. Comment below on which file in pandas/tests you'll be working on.
  2. Submit a PR that replace ensure_clean with temp_file which still passes the tests.

Once all the uses of ensure_clean are replaced, a separate PR to remove ensure_clean would be welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Testingpandas testing functions or related to the test suitegood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions