Skip to content

Commit

Permalink
further debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Aug 9, 2024
1 parent 760f373 commit d5b4003
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/unit/utils/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,16 @@ def test_is_not_aix():

def test_is_aarch64_arm64():
return_value = True
print(f"DGM test_is_aarch64_arm64, expected return value '{return_value}'", flush=True)
# Allow for MacOS Arm64 platform returns 'arm64' not 'aarch64', different than Linux
with mock.patch("platform.machine", return_value="arm64"):
with mock.patch("sys.platform", return_value="darwin"):
with mock.patch("sys.platform", new_callable=mock.PropertyMock(return_value="darwin")):
assert pytestskipmarkers.utils.platform.is_aarch64() is return_value


def test_is_aarch64_aarch64():
return_value = True
print(f"DGM test_is_aarch64_aarch64, expected return value '{return_value}'", flush=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"):
Expand All @@ -160,13 +162,18 @@ def test_is_aarch64_aarch64():

def test_is_not_aarch64():
return_value = False
print(f"DGM test_is_not_aarch64, expected return value '{return_value}'", flush=True)
with mock.patch("platform.machine", return_value="not_arm64"):
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
print(
f"DGM test_is_not_aarch64_string_aarch64, expected return value '{return_value}'",
flush=True,
)
with mock.patch("platform.machine", return_value="not_aarch64"):
assert pytestskipmarkers.utils.platform.is_aarch64() is return_value

Expand Down

0 comments on commit d5b4003

Please sign in to comment.