Skip to content

CI/TST: Use tmp_path for excel test #57516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 20, 2024
Merged

Conversation

mroeschke
Copy link
Member

tm.ensure_clean doesn't ensure files are unique if the same name is passed, but tmp_path ensures a test gets a unique temp path.

@mroeschke mroeschke added CI Continuous Integration IO Excel read_excel, to_excel labels Feb 20, 2024

@pytest.fixture
def ext():
return ".ods"


def test_write_append_mode_raises(ext):
@pytest.fixture
def tmp_excel(ext, tmp_path):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this fixture just for excel?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think our Excel code is picky about checking the file extension and hence if/how ext is defined in our tests. I think in the general case this won't matter but there might be a better way to generalize how this is set up in our Excel tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Not a blocker by any means

@mroeschke mroeschke added this to the 3.0 milestone Feb 20, 2024
@mroeschke mroeschke merged commit efdff03 into pandas-dev:main Feb 20, 2024
@mroeschke mroeschke deleted the ci/excel branch February 20, 2024 23:32
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* Revert "CI: Run excel tests on single cpu for windows (pandas-dev#57486)"

This reverts commit 9c02050.

* Use tmp_path fixture

* uuid4?

* Don't remove, pytest cleans itself up eventually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: excel tests started failing on windows
2 participants