Skip to content

Commit 90ae492

Browse files
authored
Merge pull request #849 from booxter/test-failure-aarch64-linux
fix(test): Fix failure due to different uname.machine on linux vs darwin
2 parents 9a413db + a868643 commit 90ae492

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

tests/test_constraints.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,14 @@ def test_add_constraint_conflict() -> None:
5858

5959
# Different, but equivalent markers should raise KeyError
6060
with pytest.raises(KeyError):
61-
c.add_constraint(
62-
"bar==1.0; python_version >= '3.11' and platform_machine == 'x86_64'"
63-
)
64-
c.add_constraint(
65-
"bar==1.1; platform_machine == 'x86_64' and python_version >= '3.11'"
66-
)
67-
c.add_constraint(
68-
"bar==1.0; python_version >= '3.11' and platform_machine == 'arm64'"
69-
)
70-
c.add_constraint(
71-
"bar==1.1; platform_machine == 'arm64' and python_version >= '3.11'"
72-
)
61+
# arm64 -> macos; aarch64 -> linux
62+
for arch in ["x86_64", "arm64", "aarch64"]:
63+
c.add_constraint(
64+
f"bar==1.0; python_version >= '3.11' and platform_machine == '{arch}'"
65+
)
66+
c.add_constraint(
67+
f"bar==1.1; platform_machine == '{arch}' and python_version >= '3.11'"
68+
)
7369

7470
# Same package with different markers should NOT raise error
7571
c.add_constraint("baz==1.0; platform_machine != 'ppc64le'")

0 commit comments

Comments
 (0)