(
*,
impl: str,
exe: str,
found: set[str],
version: tuple[int, int],
)
| 38 | |
| 39 | |
| 40 | def _get_default_version( |
| 41 | *, |
| 42 | impl: str, |
| 43 | exe: str, |
| 44 | found: set[str], |
| 45 | version: tuple[int, int], |
| 46 | ) -> str: |
| 47 | sys_exe = f'/fake/path/{exe}' |
| 48 | sys_impl = auto_namedtuple(name=impl) |
| 49 | sys_ver = auto_namedtuple(major=version[0], minor=version[1]) |
| 50 | |
| 51 | def find_exe(s): |
| 52 | if s in found: |
| 53 | return f'/fake/path/found/{exe}' |
| 54 | else: |
| 55 | return None |
| 56 | |
| 57 | with ( |
| 58 | mock.patch.object(sys, 'implementation', sys_impl), |
| 59 | mock.patch.object(sys, 'executable', sys_exe), |
| 60 | mock.patch.object(sys, 'version_info', sys_ver), |
| 61 | mock.patch.object(python, 'find_executable', find_exe), |
| 62 | ): |
| 63 | return python.get_default_version.__wrapped__() |
| 64 | |
| 65 | |
| 66 | def test_default_version_sys_executable_found(): |
no test coverage detected