Repository navigation
tests: skip symlink tests when platform forbids symlink creation (#5389) - #5391
Closed
Vansh-Sharmaa wants to merge 1 commit into
Closed
Vansh-Sharmaa wants to merge 1 commit into
Vansh-Sharmaa wants to merge 1 commit into
Conversation
On Windows without elevated privileges or Developer Mode enabled, creating symlinks raises OSError: [WinError 1314]. test_broken_symlink guarded against this with a skip handler since psf#287, but three tests in TestFileCollection called symlink_to directly without a guard. Add a symlink_or_skip helper and use it across all symlink creation sites so that the tests gracefully skip on platforms/environments where symlink creation is not permitted. Fixes psf#5389
Collaborator
|
Fixed by #5390. Please avoid creating PRs for issues already with open PRs without asking first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
On Windows without elevated privileges or Developer Mode enabled, creating symlinks raises
OSError: [WinError 1314] A required privilege is not held by the client.test_broken_symlinkpreviously guarded against this with a skip handler since #287, but three tests inTestFileCollection(test_get_sources_symlink_and_force_exclude,test_get_sources_with_stdin_symlink_outside_root, andtest_get_sources_with_stdin_filename_and_force_exclude_and_symlink) calledsymlink_todirectly without a guard.This PR adds a
symlink_or_skiphelper intests/test_black.pyand uses it across all symlink creation sites so that the test suite gracefully skips on platforms/environments where symlink creation is not permitted.Fixes #5389
Checklist - did you ...
--previewstyle, following the stability policy? (N/A - test fix only)CHANGES.mdif necessary? (N/A - internal test fix)