Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
q0w committed Feb 28, 2022
1 parent 9f0cd6b commit 106692f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit/test_utils_compatibility_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def test_manylinux(
glibc_ver: str,
) -> None:
*_, arch = manylinux.split("_", 3)
monkeypatch.setattr(platform, "system", lambda: "Linux")
monkeypatch.setattr(sysconfig, "get_platform", lambda: f"linux_{arch}")
monkeypatch.setattr(platform, "machine", lambda: arch)
monkeypatch.setattr(
Expand Down Expand Up @@ -193,6 +194,7 @@ def manylinux_compatible(tag_major: int, tag_minor: int, tag_arch: str) -> bool:
return tag_arch == "s390x"
return False

monkeypatch.setattr(platform, "system", lambda: "Linux")
monkeypatch.setattr(
_manylinux,
"_get_glibc_version",
Expand Down Expand Up @@ -229,6 +231,7 @@ def manylinux_compatible(
return False
return None

monkeypatch.setattr(platform, "system", lambda: "Linux")
monkeypatch.setattr(_manylinux, "_get_glibc_version", lambda: (2, 30))
monkeypatch.setattr(sysconfig, "get_platform", lambda: "linux_x86_64")
monkeypatch.setattr(
Expand Down Expand Up @@ -326,11 +329,17 @@ def test_musllinux(
arch: str,
musl_ver: Tuple[int, int],
) -> None:
monkeypatch.setattr(
_manylinux,
"_get_glibc_version",
lambda: (-1, -1),
)
monkeypatch.setattr(
_musllinux,
"_get_musl_version",
lambda _: _musllinux._MuslVersion(*musl_ver),
)
monkeypatch.setattr(platform, "system", lambda: "Linux")
monkeypatch.setattr(sysconfig, "get_platform", lambda: f"linux_{arch}")
groups: Dict[Tuple[str, str], List[str]] = {}
supported = compatibility_tags.get_supported(platforms=[f"{musllinux}_{arch}"])
Expand Down

0 comments on commit 106692f

Please sign in to comment.