Add dot prefix if file makefile extension is invalid for pathlib#8222
Conversation
bluetech
left a comment
There was a problem hiding this comment.
Thanks for looking at this!
The change currently adds a warning to pytester. I think what we want rather is:
-
Change
testdir.makefileto silently add the., to keep backward compat.testdiris going to be deprecated in its entirety sometime in the future so I wouldn't bother with something else for it. -
Change
pytester._makefileto raise a more informative error when the.is missing (currently it fails in some pathlib error). This way the newpytesterenforces the correct non-confusing usage.
|
Thanks for clarifying - I assumed If I understand correctly, I added a commit does the most naive thing: it catches and ignores the warning when using
To clarify, you're asking not for a more informative warning than in my original commit, but to catch the However, I think @RonnyPfannschmidt had a warning in mind for an So two points where I don't have strong opinions so looking for guidance/consensus:
|
First of all, welcome :) The following is how I see things, let me know if you agree. In the current state (before this PR) IMO we have 2 issues:
The way I propose to fix it is:
Note that in this solution there are no warnings or catching warnings, just a silent fix in testdir and a more friendly error in pytester. |
273117f to
8ab1d64
Compare
|
Okay, I now see the easy way to do this that I previously claimed did not exist. Thank you for loosening the scales covering my eyes. I rebased to a simple commit that should avoid the |
|
As it happens, coverage wanted to see the |
bluetech
left a comment
There was a problem hiding this comment.
LGTM! Just need an update to the changelog entry to match the latest iteration (I left a suggestion).
Co-authored-by: Ran Benita <ran@unusedvar.com>
Closes #8192