Skip to content

Commit

Permalink
fix(tests): aarch64 does not report mhz in /proc/cpuinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Jun 15, 2024
1 parent de9fdd8 commit df8d4c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"HAS_IONICE", "HAS_MEMORY_MAPS", "HAS_PROC_CPU_NUM", "HAS_RLIMIT",
"HAS_SENSORS_BATTERY", "HAS_BATTERY", "HAS_SENSORS_FANS",
"HAS_SENSORS_TEMPERATURES", "HAS_NET_CONNECTIONS_UNIX", "MACOS_11PLUS",
"MACOS_12PLUS", "QEMU_USER", "COVERAGE",
"MACOS_12PLUS", "QEMU_USER", "COVERAGE", 'AARCH64',
# subprocesses
'pyrun', 'terminate', 'reap_children', 'spawn_testproc', 'spawn_zombie',
'spawn_children_pair',
Expand Down Expand Up @@ -135,6 +135,7 @@
QEMU_USER = False
# are we a 64 bit process?
IS_64BIT = sys.maxsize > 2**32
AARCH64 = platform.machine() == "aarch64"


@memoize
Expand Down
2 changes: 2 additions & 0 deletions psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from psutil._compat import PY3
from psutil._compat import FileNotFoundError
from psutil._compat import basestring
from psutil.tests import AARCH64
from psutil.tests import GITHUB_ACTIONS
from psutil.tests import GLOBAL_TIMEOUT
from psutil.tests import HAS_BATTERY
Expand Down Expand Up @@ -831,6 +832,7 @@ def path_exists_mock(path):
assert psutil.cpu_freq()

@unittest.skipIf(not HAS_CPU_FREQ, "not supported")
@unittest.skipIf(AARCH64, "aarch64 does not report mhz in /proc/cpuinfo")
def test_emulate_use_cpuinfo(self):
# Emulate a case where /sys/devices/system/cpu/cpufreq* does not
# exist and /proc/cpuinfo is used instead.
Expand Down

0 comments on commit df8d4c0

Please sign in to comment.