Skip to content

Commit acc8b27

Browse files
committed
Add check on duplicate wheel error
1 parent 093d2d4 commit acc8b27

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/test_limited_api.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import subprocess
12
import textwrap
23

4+
import pytest
5+
36
from . import test_projects, utils
47

58
limited_api_project = test_projects.new_c_project(
@@ -25,7 +28,7 @@ def test_setup_cfg(tmp_path):
2528
assert set(actual_wheels) == set(expected_wheels)
2629

2730

28-
def test_build_option_env(tmp_path):
31+
def test_build_option_env(tmp_path, capfd):
2932
project_dir = tmp_path / 'project'
3033
test_projects.new_c_project().generate(project_dir)
3134

@@ -39,3 +42,17 @@ def test_build_option_env(tmp_path):
3942
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0', limited_api='cp36')
4043
if '-pp' not in w]
4144
assert set(actual_wheels) == set(expected_wheels)
45+
46+
47+
def test_duplicate_wheel_error(tmp_path, capfd):
48+
project_dir = tmp_path / 'project'
49+
limited_api_project.generate(project_dir)
50+
51+
with pytest.raises(subprocess.CalledProcessError):
52+
utils.cibuildwheel_run(project_dir, add_env={
53+
'CIBW_BUILD': 'cp36-* cp37-*',
54+
})
55+
56+
captured = capfd.readouterr()
57+
assert "already exists in output directory" in captured.err
58+
assert "It looks like you are building wheels against Python's limited API" in captured.err

0 commit comments

Comments
 (0)