test(windows): skip the symlink case of the cached venv test without symlinks (#4571) `test_replaces_dangling_package_link_before_creating_child_link` needs to create symlinks, so it fails on Windows without the privilege to create them, which is the case #4509 is for. Skip it there. The junction case still runs. Tested on Windows 11 26H2 with Developer Mode off: the symlink case is skipped and the other two cases pass. On `main`, the symlink case fails. The tests also pass on Linux.
diff --git a/tests/bootstrap_impls/cached_venv_dangling_symlink_test.py b/tests/bootstrap_impls/cached_venv_dangling_symlink_test.py index 363736d..35f9c54 100644 --- a/tests/bootstrap_impls/cached_venv_dangling_symlink_test.py +++ b/tests/bootstrap_impls/cached_venv_dangling_symlink_test.py
@@ -41,7 +41,17 @@ return bootstrap +def _can_create_symlinks() -> bool: + with tempfile.TemporaryDirectory() as temp: + try: + os.symlink(temp, os.path.join(temp, "link"), target_is_directory=True) + except OSError: + return False + return True + + class CachedVenvDanglingSymlinkTest(unittest.TestCase): + @unittest.skipUnless(_can_create_symlinks(), "can't create symlinks") def test_replaces_dangling_package_link_before_creating_child_link(self) -> None: self._test_replaces_dangling_package_link(symlinks_supported=True)