diff --git a/test/12_dependency_versions/cibuildwheel_test.py b/test/12_dependency_versions/cibuildwheel_test.py index d0d419d0..764a5d30 100644 --- a/test/12_dependency_versions/cibuildwheel_test.py +++ b/test/12_dependency_versions/cibuildwheel_test.py @@ -45,34 +45,34 @@ def test_pinned_versions(python_version): cibw_environment_option = ' '.join( ['{}={}'.format(k, v) for k, v in build_environment.items()] ) - cibw_build_option = 'cp27-*' if python_version == '2.7' else 'cp3*' # build and test the wheels actual_wheels = utils.cibuildwheel_run(project_dir, add_env={ - 'CIBW_BUILD': cibw_build_option, + 'CIBW_BUILD': '[cp]p27-*' if python_version == '2.7' else '[cp]p3?-*', 'CIBW_ENVIRONMENT': cibw_environment_option, }) # also check that we got the right wheels if python_version == '2.7': expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0') - if '-cp27' in w] + if '-cp27' in w or '-pp27' in w] else: expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0') - if '-cp27' not in w and '-pypy' not in w] + if '-cp27' not in w and '-pp27' not in w] assert set(actual_wheels) == set(expected_wheels) -def test_dependency_constraints_file(tmp_path): +@pytest.mark.parametrize('python_version', ['2.7', '3.x']) +def test_dependency_constraints_file(tmp_path, python_version): if utils.platform == 'linux': pytest.skip('linux doesn\'t pin individual tool versions, it pins manylinux images instead') project_dir = os.path.dirname(__file__) tool_versions = { - 'pip': '20.0.2', - 'setuptools': '44.0.0', + 'pip': '20.0.1', + 'setuptools': '44.0.0' if python_version == '2.7' else '46.0.0', 'wheel': '0.34.2', 'virtualenv': '16.7.8', } @@ -99,10 +99,17 @@ def test_dependency_constraints_file(tmp_path): # build and test the wheels actual_wheels = utils.cibuildwheel_run(project_dir, add_env={ + 'CIBW_BUILD': '[cp]p27-*' if python_version == '2.7' else '[cp]p3?-*', 'CIBW_ENVIRONMENT': cibw_environment_option, 'CIBW_DEPENDENCY_VERSIONS': str(constraints_file), }) # also check that we got the right wheels - expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')] + if python_version == '2.7': + expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0') + if '-cp27' in w or '-pp27' in w] + else: + expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0') + if '-cp27' not in w and '-pp27' not in w] + assert set(actual_wheels) == set(expected_wheels)