fix(tests): skip symlink tests when symlink creation is unprivileged - #921
Open
MohammedAlkindi wants to merge 1 commit into
Open
MohammedAlkindi wants to merge 1 commit into
MohammedAlkindi wants to merge 1 commit into
Conversation
os.symlink needs Administrator rights or Developer Mode on Windows, and Developer Mode is off by default. Five functional tests called it unguarded, so a local Windows contributor running make pr saw WinError 1314 rather than a clean run. Probe the capability in tests/testing_utils.py and skipUnless on it, matching the Windows-awareness already in read_link_without_junction_prefix.
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.
Issue #, if available: none filed.
Description of changes
os.symlinkneeds Administrator rights or Developer Mode on Windows, and Developer Mode is off by default. Five functional tests call it unguarded, so a Windows contributor running the documentedmake prgetsOSError: [WinError 1314]on a change unrelated to symlinks. CI misses it because GitHub'swindows-latestrunners are elevated.Adds a
symlinks_supported()probe totests/testing_utils.pyand gates those five withskipUnless, mirroring the Windows-awareness already inread_link_without_junction_prefix. Test-only, no production code touched.Description of how you validated changes
Windows 11, Developer Mode off, Python 3.14. Before: all five fail, four directly on
os.symlinkwith WinError 1314, andtest_link_directoryon anislink()assertion after the production fallback copies instead. After: the same five skip with a reason.tests/unit831 passed either way, andblack --checkis clean on the three files.Six
test_cli.pyfailures appear both before and after on my machine, unrelated to this change (a localsubprocessWinError 2), so the failing set is otherwise identical.Checklist