|
10 | 10 |
|
11 | 11 |
|
12 | 12 | if platform.system() == 'Linux':
|
13 |
| - VENDORING_DEPS = {mesonpy._depstr.patchelf_wrapper} |
| 13 | + VENDORING_DEPS = {mesonpy._depstr.patchelf} |
14 | 14 | else:
|
15 | 15 | VENDORING_DEPS = set()
|
16 | 16 |
|
17 | 17 |
|
18 | 18 | @pytest.mark.parametrize(
|
19 |
| - ('package', 'expected'), |
| 19 | + ('package', 'system_patchelf', 'expected'), |
20 | 20 | [
|
21 |
| - ('pure', set()), # pure and no PEP 621 |
22 |
| - ('library', VENDORING_DEPS), # not pure and not PEP 621 |
| 21 | + ('pure', True, set()), # pure and system patchelf |
| 22 | + ('library', True, set()), # not pure and system patchelf |
| 23 | + ('pure', False, set()), # pure and no system patchelf |
| 24 | + ('library', False, VENDORING_DEPS), # not pure and no system patchelf |
23 | 25 | ]
|
24 | 26 | )
|
25 |
| -def test_get_requires_for_build_wheel(package, expected): |
| 27 | +def test_get_requires_for_build_wheel(mocker, package, expected, system_patchelf): |
| 28 | + mock = mocker.patch('shutil.which', return_value=system_patchelf) |
| 29 | + |
| 30 | + if mock.called: # sanity check for the future if we add another usage |
| 31 | + mock.assert_called_once_with('patchelf') |
| 32 | + |
26 | 33 | with cd_package(package):
|
27 | 34 | assert set(mesonpy.get_requires_for_build_wheel()) == expected | {
|
28 | 35 | mesonpy._depstr.wheel,
|
|
0 commit comments