Skip to content

Commit 10b8a78

Browse files
committed
tests: use pytest-subprocess to support Windows & PyPy
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 5b38abd commit 10b8a78

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ test = [
4141
'pytest',
4242
'pytest-cov',
4343
'pytest-mock',
44+
'pytest-virtualenv',
4445
'GitPython',
4546
'auditwheel',
4647
'Cython',

tests/test_pep518.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import subprocess
2-
31
import pytest
42

53
from .conftest import cd_package
@@ -12,16 +10,12 @@
1210
]
1311
)
1412
@pytest.mark.parametrize(
15-
'build_args', [(), ('--wheel',)], ids=['sdist_to_wheel', 'wheel_directly']
13+
'build_args', ['', '--wheel'], ids=['sdist_to_wheel', 'wheel_directly']
1614
)
17-
def test_pep518(pep518, virtual_env, package, build_args, tmp_path):
15+
def test_pep518(pep518, virtualenv, package, build_args, tmp_path):
1816
dist = tmp_path / 'dist'
1917

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')
2219

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

Comments
 (0)