Skip to content

Transition away from tmpdir #600

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

Closed
lilyminium opened this issue Jan 20, 2025 · 4 comments · Fixed by #615
Closed

Transition away from tmpdir #600

lilyminium opened this issue Jan 20, 2025 · 4 comments · Fixed by #615
Assignees
Milestone

Comments

@lilyminium
Copy link
Contributor

Apparently my favourite pytest fixture, tmpdir, is now getting deprecated in favour of tmp_path. Tests should transition away from tmpdir. :-(

@mattwthompson
Copy link
Member

Is it a %s/tmpdir/tmp_path/g sort of deal?

@lilyminium
Copy link
Contributor Author

Something like that yes, I think my favourite one-liner with tmpdir.as_cwd() may now need to be replaced with os.chdir(tmp_path) as well. :-(

@mattwthompson
Copy link
Member

I think that bit is handled by https://github.com/openforcefield/openff-utilities/blob/v0.1.14/openff/utilities/utilities.py#L154 ? IIUC you don't really care where tempdir.as_cwd() puts you, and it also being a context manager means the code inside it doesn't need to be moved to the left or right

@lilyminium
Copy link
Contributor Author

Oh that's really nice, I'd missed that utility -- thanks for the link!

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 a pull request may close this issue.

2 participants