-
Notifications
You must be signed in to change notification settings - Fork 211
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
Replace tmpdir with tmp_path in tests #126
Conversation
Codecov Report
@@ Coverage Diff @@
## master #126 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 466 467 +1
=========================================
+ Hits 466 467 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
Thank your for the review, everything updated. Should I squash it to a single commit or do you want to do it in the merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Great work (minor styling comments left)!
Feel free to squash into a single commit (force-push), and maybe we can briefly mention py
vs. pathlib
in the commit description?
Thanks for your contribution.
pytest's tmpdir uses py.path which is in maintenance mode. Everyone, pytest included, is migrating to tmp_path returning a stdlib's pathlib.Path object. I also moved the test data file dot_red.png to an extra testdata directory.
@xflr6 thank you for the review, I have committed your latest notes as well and squashed to a single commit with a longer description. |
As discussed in #125, this replaces
tmpdir
withtmp_path
in all tests (andtmpdir_factory
withtmp_path_factory
), because thepy.path
used astmpdir
is in maintenance mode andpytest
is also migrating totmp_path
.This adds some code though because
py.path
had special functions for almost everything and here they have to be supplied withos
andshutil
.Next step would be replacing all
os.path
/glob
/open
calls in the main code withpathlib.Path
.