Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/test_py_info_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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"
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_py_info_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/windows/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down