Skip to content

Commit

Permalink
Adjust aarch64 and arm64 testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Aug 9, 2024
1 parent 6e021e2 commit 8a31aa5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/unit/utils/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,32 @@ def test_is_not_aix():
assert pytestskipmarkers.utils.platform.is_aix() is return_value


def test_is_aarch64():
def test_is_aarch64_arm64():
return_value = True
# Allow for MacOS Arm64 platform returns 'arm64' not 'aarch64', different than Linux
with mock.patch("platform.machine", return_value="arm64"):
assert pytestskipmarkers.utils.platform.is_aarch64() is return_value
with mock.patch("sys.platform", return_value="darwin"):
assert pytestskipmarkers.utils.platform.is_aarch64() is return_value


def test_is_aarch64_aarch64():
return_value = True
# Allow for MacOS Arm64 platform returns 'arm64' not 'aarch64', different than Linux
with mock.patch("platform.machine", return_value="aarch64"):
with mock.patch("sys.platform", return_value="not_darwin"):
assert pytestskipmarkers.utils.platform.is_aarch64() is return_value


def test_is_not_aarch64():
return_value = False
with mock.patch("platform.machine", return_value="not_arm64"):
assert pytestskipmarkers.utils.platform.is_aarch64() is return_value
with mock.patch("sys.platform", return_value="darwin"):
assert pytestskipmarkers.utils.platform.is_aarch64() is return_value


def test_is_not_aarch64_string_aarch64():
return_value = False
# Allow for MacOS Arm64 platform returning differently from Linux
with mock.patch("platform.machine", return_value="aarch64"):
with mock.patch("platform.machine", return_value="not_aarch64"):
assert pytestskipmarkers.utils.platform.is_aarch64() is return_value


Expand Down

0 comments on commit 8a31aa5

Please sign in to comment.