summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Darbois <mayeut@users.noreply.github.com>2022-10-18 22:18:05 +0200
committerGitHub <noreply@github.com>2022-10-18 22:18:05 +0200
commit1da9f7928e79ecc127768e7a5bc4eb7f785f4513 (patch)
tree468690e062b5e933b0e712f785c39251a04c2888
parent037e5a9cdf9365b8e4d4cfd5eb8b081d5cc66de2 (diff)
downloadpsutil-1da9f7928e79ecc127768e7a5bc4eb7f785f4513.tar.gz
chore: skip test_cpu_freq on macOS arm64 (#2146)
-rwxr-xr-xpsutil/tests/test_contracts.py3
-rwxr-xr-xpsutil/tests/test_memleaks.py3
-rwxr-xr-xpsutil/tests/test_osx.py3
-rwxr-xr-xpsutil/tests/test_system.py3
4 files changed, 12 insertions, 0 deletions
diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py
index d376a338..fde857b6 100755
--- a/psutil/tests/test_contracts.py
+++ b/psutil/tests/test_contracts.py
@@ -12,6 +12,7 @@ Some of these are duplicates of tests test_system.py and test_process.py
import errno
import multiprocessing
import os
+import platform
import signal
import stat
import sys
@@ -235,6 +236,8 @@ class TestSystemAPITypes(PsutilTestCase):
def test_cpu_count(self):
self.assertIsInstance(psutil.cpu_count(), int)
+ # TODO: remove this once 1892 is fixed
+ @unittest.skipIf(MACOS and platform.machine() == 'arm64', "skipped due to #1892")
@unittest.skipIf(not HAS_CPU_FREQ, "not supported")
def test_cpu_freq(self):
if psutil.cpu_freq() is None:
diff --git a/psutil/tests/test_memleaks.py b/psutil/tests/test_memleaks.py
index e507e837..8d31193b 100755
--- a/psutil/tests/test_memleaks.py
+++ b/psutil/tests/test_memleaks.py
@@ -19,6 +19,7 @@ from __future__ import print_function
import functools
import os
+import platform
import unittest
import psutil
@@ -364,6 +365,8 @@ class TestModuleFunctionsLeaks(TestMemoryLeak):
self.execute(psutil.cpu_stats)
@fewtimes_if_linux()
+ # TODO: remove this once 1892 is fixed
+ @unittest.skipIf(MACOS and platform.machine() == 'arm64', "skipped due to #1892")
@unittest.skipIf(not HAS_CPU_FREQ, "not supported")
def test_cpu_freq(self):
self.execute(psutil.cpu_freq)
diff --git a/psutil/tests/test_osx.py b/psutil/tests/test_osx.py
index d0f588ad..8abddb52 100755
--- a/psutil/tests/test_osx.py
+++ b/psutil/tests/test_osx.py
@@ -6,6 +6,7 @@
"""macOS specific tests."""
+import platform
import re
import time
import unittest
@@ -144,6 +145,8 @@ class TestSystemAPIs(PsutilTestCase):
num = sysctl("sysctl hw.physicalcpu")
self.assertEqual(num, psutil.cpu_count(logical=False))
+ # TODO: remove this once 1892 is fixed
+ @unittest.skipIf(platform.machine() == 'arm64', "skipped due to #1892")
def test_cpu_freq(self):
freq = psutil.cpu_freq()
self.assertEqual(
diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py
index 753249bc..42b29e8f 100755
--- a/psutil/tests/test_system.py
+++ b/psutil/tests/test_system.py
@@ -10,6 +10,7 @@ import contextlib
import datetime
import errno
import os
+import platform
import pprint
import shutil
import signal
@@ -511,6 +512,8 @@ class TestCpuAPIs(PsutilTestCase):
if not AIX and name in ('ctx_switches', 'interrupts'):
self.assertGreater(value, 0)
+ # TODO: remove this once 1892 is fixed
+ @unittest.skipIf(MACOS and platform.machine() == 'arm64', "skipped due to #1892")
@unittest.skipIf(not HAS_CPU_FREQ, "not supported")
def test_cpu_freq(self):
def check_ls(ls):