diff --git a/tests/test_py_info_collect.py b/tests/test_py_info_collect.py index 4220b59..c6c4e65 100644 --- a/tests/test_py_info_collect.py +++ b/tests/test_py_info_collect.py @@ -271,6 +271,7 @@ def test_system_executable_from_existing_base(mocker: MockerFixture, tmp_path: P @pytest.mark.usefixtures("no_framework") +@pytest.mark.skipif(sys.platform == "win32", reason="POSIX versioned executable fallback") def test_system_executable_prefers_exact_version_for_distinct_file(mocker: MockerFixture, tmp_path: Path) -> None: bin_dir = tmp_path / "bin" bin_dir.mkdir() @@ -285,6 +286,7 @@ def test_system_executable_prefers_exact_version_for_distinct_file(mocker: Mocke @pytest.mark.usefixtures("no_framework") +@pytest.mark.skipif(sys.platform == "win32", reason="POSIX executable symlink") def test_system_executable_prefers_generic_alias_of_exact_version(mocker: MockerFixture, tmp_path: Path) -> None: bin_dir = tmp_path / "bin" bin_dir.mkdir() @@ -301,6 +303,7 @@ def test_system_executable_prefers_generic_alias_of_exact_version(mocker: Mocker assert PythonInfo().system_executable == str(generic) +@pytest.mark.skipif(sys.platform == "win32", reason="POSIX versioned executable fallback") def test_system_executable_versioned_fallback(mocker: MockerFixture, tmp_path: Path) -> None: _venv_missing_base_no_candidates(mocker, tmp_path) versioned = tmp_path / "python3.12" @@ -309,6 +312,7 @@ def test_system_executable_versioned_fallback(mocker: MockerFixture, tmp_path: P assert PythonInfo().system_executable == str(versioned) +@pytest.mark.skipif(sys.platform == "win32", reason="POSIX versioned executable fallback") def test_system_executable_pypy_fallback(mocker: MockerFixture, tmp_path: Path) -> None: _venv_missing_base_no_candidates(mocker, tmp_path) mocker.patch("platform.python_implementation", return_value="PyPy", autospec=True) diff --git a/tests/test_py_info_extra.py b/tests/test_py_info_extra.py index 7bc629b..4ec0515 100644 --- a/tests/test_py_info_extra.py +++ b/tests/test_py_info_extra.py @@ -377,9 +377,9 @@ def test_sysconfig_path_no_config_var() -> None: assert len(result) > 0 -def test_satisfies_abs_spec_path_falls_through() -> None: +def test_satisfies_abs_spec_path_falls_through(tmp_path: Path) -> None: info = copy.deepcopy(_CURRENT) - spec = PythonSpec("", None, None, None, None, None, "/some/other/python") + spec = PythonSpec("", None, None, None, None, None, str(tmp_path / "other" / "python")) assert spec.is_abs is True assert info.satisfies(spec, impl_must_match=False) is True diff --git a/tests/windows/conftest.py b/tests/windows/conftest.py index 0525ae9..0cbd8f9 100644 --- a/tests/windows/conftest.py +++ b/tests/windows/conftest.py @@ -138,6 +138,7 @@ def _mock_pyinfo(mocker: MockerFixture, major: int, minor: int, arch: int, exe: info.free_threaded = threaded info.sysconfig_platform = "win-amd64" if arch == 64 else "win32" info.machine = "x86_64" if arch == 64 else "x86" + info.resolve_to_system.return_value = info def satisfies(spec: PythonSpec, **_kwargs: object) -> bool: if spec.implementation is not None and spec.implementation.lower() != "cpython":