Skip to content
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

fix: some tests missing tmp_path argument/implementation #85

Merged
merged 4 commits into from
Mar 25, 2024

Conversation

zbilodea
Copy link
Collaborator

No description provided.

@zbilodea zbilodea linked an issue Mar 25, 2024 that may be closed by this pull request
@zbilodea zbilodea merged commit f94ce65 into main Mar 25, 2024
13 checks passed
@zbilodea zbilodea deleted the fix-test-filepaths branch March 25, 2024 12:36
Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

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

@zbilodea nice work! 🚀 Here's examples of some quick fixes you can apply to simplify this even more by removing the use of os.join and avoid calls to Path() that don't do anything

arrays = uproot.open(skhep_testdata.data_path("uproot-hepdata-example.root"))[
"ntuple;1"
].arrays()

ak.to_parquet(arrays, "uproot-hepdata-example.parquet")
ak.to_parquet(arrays, Path(tmp_path) / "uproot-hepdata-example.parquet")
Copy link
Member

Choose a reason for hiding this comment

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

There's no need to wrap tmp_path again here, as it is explicitly a pathlib.Path object. so all these can be just tmp_path instead of Path(tmp_path).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use pytest's tmp_path fixture for tests that need paths to files
2 participants