|
1 |
| -import subprocess |
2 |
| - |
3 | 1 | import pytest
|
4 | 2 |
|
5 | 3 | from .conftest import cd_package
|
|
12 | 10 | ]
|
13 | 11 | )
|
14 | 12 | @pytest.mark.parametrize(
|
15 |
| - 'build_args', [(), ('--wheel',)], ids=['sdist_to_wheel', 'wheel_directly'] |
| 13 | + 'build_args', ['', '--wheel'], ids=['sdist_to_wheel', 'wheel_directly'] |
16 | 14 | )
|
17 |
| -def test_pep518(pep518, virtual_env, package, build_args, tmp_path): |
| 15 | +def test_pep518(pep518, virtualenv, package, build_args, tmp_path): |
18 | 16 | dist = tmp_path / 'dist'
|
19 | 17 |
|
20 |
| - result = subprocess.run([str(virtual_env), '-m', 'pip', 'install', 'build'], check=False) |
21 |
| - assert result.returncode == 0 |
| 18 | + virtualenv.run('python -m pip install build') |
22 | 19 |
|
23 |
| - with cd_package(package): |
24 |
| - result = subprocess.run( |
25 |
| - [str(virtual_env), '-m', 'build', f'--outdir={dist}', *build_args], check=False |
26 |
| - ) |
27 |
| - assert result.returncode == 0 |
| 20 | + with cd_package(package) as package_dir: |
| 21 | + virtualenv.run(f'python -m build --outdir={dist} {build_args}', cwd=package_dir) |
0 commit comments