1
0
Fork 0

Merging upstream version 3.0.2.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:36:17 +01:00
parent 962b6a60c2
commit 3904671ae3
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
107 changed files with 1775 additions and 2323 deletions

View file

@ -1,5 +1,6 @@
from __future__ import annotations
from typing import Mapping
from unittest import mock
import pytest
@ -48,7 +49,9 @@ def test_installs_with_bootstrapped_rustup(tmpdir, language_version):
original_find_executable = parse_shebang.find_executable
def mocked_find_executable(exe: str) -> str | None:
def mocked_find_executable(
exe: str, *, env: Mapping[str, str] | None = None,
) -> str | None:
"""
Return `None` the first time `find_executable` is called to ensure
that the bootstrapping code is executed, then just let the function
@ -59,7 +62,7 @@ def test_installs_with_bootstrapped_rustup(tmpdir, language_version):
find_executable_exes.append(exe)
if len(find_executable_exes) == 1:
return None
return original_find_executable(exe)
return original_find_executable(exe, env=env)
with mock.patch.object(parse_shebang, 'find_executable') as find_exe_mck:
find_exe_mck.side_effect = mocked_find_executable