Skip to content

Commit 78bca57

Browse files
authored
fix(tests): linux tests from macOS/Windows arm64 (pypa#1829)
* fix(tests): linux tests from macOS/Windows arm64 When running on arm64, macOS reports machine as `arm64` and Windows as `ARM64`. We need to override this to `aarch64` when running linux tests. * fix(tests): fix tests when running with `--run-cp38-universal2`
1 parent f8894e6 commit 78bca57

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

test/test_macos_archs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,15 @@ def test_universal2_testing_on_arm64(tmp_path, capfd):
202202
assert set(actual_wheels) == set(expected_wheels)
203203

204204

205-
def test_cp38_arm64_testing(tmp_path, capfd):
205+
def test_cp38_arm64_testing(tmp_path, capfd, request):
206206
if utils.platform != "macos":
207207
pytest.skip("this test is only relevant to macos")
208208
if get_xcode_version() < (12, 2):
209209
pytest.skip("this test only works with Xcode 12.2 or greater")
210210
if platform.machine() != "arm64":
211211
pytest.skip("this test only works on arm64")
212+
if request.config.getoption("--run-cp38-universal2"):
213+
pytest.skip("--run-cp38-universal2 option skips this test")
212214

213215
project_dir = tmp_path / "project"
214216
basic_project.generate(project_dir)

test/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ def expected_wheels(
147147

148148
if machine_arch is None:
149149
machine_arch = pm.machine()
150+
if platform == "linux" and machine_arch.lower() == "arm64":
151+
# we're running linux tests from macOS/Windows arm64, override platform
152+
machine_arch = "aarch64"
150153

151154
if manylinux_versions is None:
152155
if machine_arch == "x86_64":

0 commit comments

Comments
 (0)