@@ -133,3 +133,36 @@ def test_universal2_testing(tmp_path, capfd, skip_arm64_test):
133133 expected_wheels = [w for w in ALL_MACOS_WHEELS if "cp39" in w and "universal2" in w ]
134134
135135 assert set (actual_wheels ) == set (expected_wheels )
136+
137+
138+ def test_cp38_arm64_testing (tmp_path , capfd ):
139+ if utils .platform != "macos" :
140+ pytest .skip ("this test is only relevant to macos" )
141+ if get_xcode_version () < (12 , 2 ):
142+ pytest .skip ("this test only works with Xcode 12.2 or greater" )
143+ if platform .machine () != "arm64" :
144+ pytest .skip ("this test only works on arm64" )
145+
146+ project_dir = tmp_path / "project"
147+ basic_project .generate (project_dir )
148+
149+ actual_wheels = utils .cibuildwheel_run (
150+ project_dir ,
151+ add_env = {
152+ "CIBW_BUILD" : "cp38-*" ,
153+ "CIBW_TEST_COMMAND" : '''python -c "import platform; print('running tests on ' + platform.machine())"''' ,
154+ "CIBW_ARCHS" : "x86_64,universal2,arm64" ,
155+ },
156+ )
157+
158+ captured = capfd .readouterr ()
159+
160+ assert "running tests on x86_64" in captured .out
161+ assert "running tests on arm64" not in captured .out
162+
163+ warning_message = "While cibuildwheel can build CPython 3.8 universal2/arm64 wheels, we cannot test the arm64 part of them"
164+ assert warning_message in captured .err
165+
166+ expected_wheels = [w for w in ALL_MACOS_WHEELS if "cp38" in w ]
167+
168+ assert set (actual_wheels ) == set (expected_wheels )
0 commit comments