Skip to content

Commit

Permalink
Updated tests for is_aarch64 returns
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Aug 9, 2024
1 parent 575f523 commit 6e021e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion changelog/36.improvement.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Added support for is_arm64 for MacOS and is_x86_64, and updated pre-commit, drop support for Python 3.7
Updated is_aarch64 to allow for MacOS Arm64 using 'arm64' instead of 'aarch64', updated pre-commit, drop support for Python 3.7
12 changes: 10 additions & 2 deletions tests/unit/utils/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,21 @@ def test_is_not_aix():

def test_is_aarch64():
return_value = True
with mock.patch("platform.machine", return_value="aarch64"):
# 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


def test_is_not_aarch64():
return_value = False
with mock.patch("platform.machine", return_value="not_aarch64"):
with mock.patch("platform.machine", return_value="not_arm64"):
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"):
assert pytestskipmarkers.utils.platform.is_aarch64() is return_value


Expand Down

0 comments on commit 6e021e2

Please sign in to comment.