Rework tests check all wheels produced against a reference list

Also, wrap the cibuildwheel call to make building env easier
This commit is contained in:
Joe Rickerby
2019-04-23 22:15:02 +01:00
parent e360a04dc1
commit e87032c830
8 changed files with 126 additions and 146 deletions
+6 -14
View File
@@ -1,5 +1,4 @@
import subprocess, sys, os, pytest
from glob import glob
import os, pytest
import utils
def test():
@@ -8,19 +7,12 @@ def test():
if utils.platform != 'linux':
pytest.skip('the docker test is only relevant to the linux build')
# set up the environment
env = os.environ.copy()
# change the docker images to use. The docker image is tested in setup.py
# during the build
env.update({
utils.run_cibuildwheel(project_dir, add_env={
'CIBW_MANYLINUX1_X86_64_IMAGE': 'dockcross/manylinux-x64',
'CIBW_MANYLINUX1_I686_IMAGE': 'dockcross/manylinux-x86',
})
# build the wheels
subprocess.check_call([sys.executable, '-m', 'cibuildwheel', project_dir], env=env)
# check that we got the right number of built wheels
expected_identifiers = utils.cibuildwheel_get_build_identifiers(project_dir)
built_wheels = glob('wheelhouse/*.whl')
assert len(built_wheels) == len(expected_identifiers)
# also check that we got the right wheels built
expected_wheels = utils.expected_wheels('spam', '0.1.0')
actual_wheels = os.listdir('wheelhouse')
assert set(actual_wheels) == set(expected_wheels)