Skip to content

test: skip POSIX-venv wheel-build tests on Windows - #4078

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
iam-kira:test/skip-posix-venv-symlink-tests-on-windows
Sep 19, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
iam-kira:test/skip-posix-venv-symlink-tests-on-windows

Conversation

@iam-kira

Copy link
Copy Markdown
Contributor

What

test_build_wheel_in_non_base_pkg_env, test_build_wheel_in_free_threaded_pkg_env,
and test_build_wheel_in_debug_pkg_env (in tests/tox_env/python/test_python_api.py)
error in setup on Windows without elevation or Developer Mode:

OSError: [WinError 1314] A required privilege is not held by the client

Each mocks a virtualenv via _fake_session, which builds a POSIX layout by creating a
bin/python symlink to sys.executable. os.symlink needs a privilege an ordinary
Windows user doesn't have, and the bin/python layout is POSIX-only regardless (Windows
venvs use Scripts\python.exe). CI stays green because the windows-latest runner can
create symlinks, so this only bites an unprivileged Windows contributor's local run.

Fix

Guard the three tests with @pytest.mark.skipif(sys.platform == "win32", ...), matching
the convention already used throughout the suite (e.g. tests/execute/local_subprocess/).

Note

Verified with py_compile and by inspection. If you'd rather keep Windows coverage by
making the mock cross-platform (Scripts/python.exe on Windows, no symlink), happy to do
that instead — the skip is the minimal, convention-matching option.

🤖 Generated with Claude Code

test_build_wheel_in_{non_base,free_threaded,debug}_pkg_env mock a POSIX venv by creating a bin/python symlink to sys.executable. os.symlink raises OSError (WinError 1314) on Windows without elevation or Developer Mode, erroring these tests in setup; the mocked layout is POSIX-only regardless. Guard with skipif(sys.platform == 'win32'), matching the convention already used across the suite.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gaborbernat
gaborbernat merged commit 2f96e32 into tox-dev:main Sep 19, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants