GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Skip tests that need symlink privileges instead of erroring by Cyrus580529 · Pull Request #2197 · gitpython-developers/GitPython

Conversation

@Cyrus580529

@Cyrus580529 Cyrus580529 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move the symlink capability probe out of test/test_index.py into test/lib/helper.py as symlinks_supported(), and add a requires_symlinks skip marker beside it.
  • Apply the marker to the three tests that call os.symlink unguarded and error with OSError: [WinError 1314] on a Windows account without Developer Mode or SeCreateSymbolicLinkPrivilege.
  • Drop the two existing copies of the check: the private probe in test_index.py, and the inline try/except plus skipTest in test_refs.py.

The tests that were erroring:

  • test_repo.py::TestRepo::test_ignored_raises_error_w_symlink
  • test_util.py::TestRmtree::test_avoids_changing_permissions_outside_tree
  • test_installation.py::TestInstallation::test_installation

CI doesn't show this because the GitHub Windows runners hold the privilege, so the three run and pass there.

One behaviour note: the probe used to return early on non-Windows, so it never created anything. Now it always creates and removes a symlink in a temporary directory, on every platform.

Validation

Windows 11, Python 3.13, after ./init-tests-after-clone.sh:

  • python -m pytest --ignore=test/performance — before: 6 failed, 711 passed, 47 skipped. After: 3 failed, 711 passed, 50 skipped.
  • The three remaining failures are unrelated to symlinks: test_commit_msg_hook_fail, test_pre_commit_hook_fail, and test_index_mutation, which passes a POSIX absolute path to git rm.
  • python -m ruff check test/
  • python -m ruff format --check test/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Cyrus580529 added 3 commits August 4, 2026 16:25
@Cyrus580529 @Byron
test: add a shared symlink capability guard
30d05e3
Whether a symlink can be created isn't decided by the platform alone: on
Windows it needs Developer Mode or SeCreateSymbolicLinkPrivilege.
@Cyrus580529 @Byron
test: skip tests that need symlink privileges
e3e5da8
These called os.symlink unguarded, so on a Windows account without the
privilege they errored with WinError 1314 instead of being skipped.
@Cyrus580529 @Byron
test: use the shared guard instead of local copies
b10e250
test_index had a private probe and test_refs repeated the same check
inline.
@Byron
Byron force-pushed the shared-symlink-guard branch from 57a2232 to b10e250 Compare August 4, 2026 14:28
@Byron
Byron merged commit fc2f02c into gitpython-developers:main Aug 4, 2026
53 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Cyrus580529 @Byron
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.