Skip to content

Commit 2f96e32

Browse files
iam-kiraclaude
andauthored
test: skip POSIX-venv wheel-build tests on Windows (tox-dev#4078)
## 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](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 99f4421 commit 2f96e32

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/tox_env/python/test_python_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def test_validate_base_python_conflicting_factors_no_ignore() -> None:
8080
Python._validate_base_python("unit-py3.10-2.16", ["python3"], ignore_base_python_conflict=False) # ruff:ignore[private-member-access]
8181

8282

83+
@pytest.mark.skipif(sys.platform == "win32", reason="mocks a POSIX venv layout (bin/python symlink)")
8384
def test_build_wheel_in_non_base_pkg_env(
8485
tox_project: ToxProjectCreator,
8586
patch_prev_py: PatchPrevPy,
@@ -112,6 +113,7 @@ def _fake_session(env_dir: list[str], **_: object) -> MagicMock:
112113
]
113114

114115

116+
@pytest.mark.skipif(sys.platform == "win32", reason="mocks a POSIX venv layout (bin/python symlink)")
115117
def test_build_wheel_in_free_threaded_pkg_env(
116118
tox_project: ToxProjectCreator,
117119
patch_prev_py: PatchPrevPy,
@@ -144,6 +146,7 @@ def _fake_session(env_dir: list[str], **_: object) -> MagicMock:
144146
]
145147

146148

149+
@pytest.mark.skipif(sys.platform == "win32", reason="mocks a POSIX venv layout (bin/python symlink)")
147150
def test_build_wheel_in_debug_pkg_env(
148151
tox_project: ToxProjectCreator,
149152
patch_prev_py: PatchPrevPy,

0 commit comments

Comments
 (0)