Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 issue where working dir becomes wrong on subst drive on Windows. Fixes #5965 #6523
Fix issue where working dir becomes wrong on subst drive on Windows. Fixes #5965 #6523
Changes from all commits
008555d
ff6af8a
0f31d8a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
i fear that this detail change may cause some troublr wrt resolution of symlinks
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.
@RonnyPfannschmidt, well, the whole point of the pull request is not resolving symlinks (I think my comment at #6523 (comment) explains the rationale).
I'll reword it here, so, hopefully it's clearer: if pytest does resolve symlinks, it's not possible to actually use symlinks to structure projects (be it subst drives, junctions or symlinks) because the paths reported by pytest never match the
cwd
being used for the run and the only usage for symlinks is as a helper tocd
into a directory (which is what the current symlink resolution accomplishes).So, what pytest maintainers need to decide is what is the wanted behavior for
pytest
(and I believe those are mutually exclusive, either users are allowed to use symlinks to structure the project or users are allowed to use symlinks as a helper tocd
into a directory).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.
on linux/unix the resolve behaviour makes a lot of sense (and makes things better/avoids certain issues) on windows it seems like the resolve behavour should be to "not" do it if it can be avoided so its a topic where any binary choice is "bad" and a non-binary one may be even worse
in any case its a breaking change that requires a major version, im kinda onboard with making it happen, but i wonder if it should be controllable with a environment variable with sane defaults for unix to resolve and for windows to "not" resolve
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.
I'm ok in checking for an env variable and updating the patch (and possibly making the default different for each OS). How do you think it should be named?
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.
Not using Linux as a desktop, I can only speak to Windows, but, in my experience, most apps don't do any resolution of symlinks on Windows, so if pytest DOES resolve, paths to the same file will not match. IMHO, an env var is fine for people to configure for those edge cases, but the default for each OS should be the thing that will work for most people. So, in this case, resolve for Linux (as it currently is) and don't resolve for Windows (as it WAS pre-v5.1.0).
Given the above, I would argue that it isn't a breaking change - there is no change on Linux and it is fixing a bug that was introduced in v5.1.0 on Windows. It's probably not that common for people to use subst on Windows so probably not affecting most Windows users either. If there is anything I can do to help beyond giving my opinions, please let me know how. :-)
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.
I agree with Adam