skip problematic unit test
This commit is contained in:
parent
a32e126863
commit
1a0cc2acdf
|
@ -11,7 +11,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_contracts.py psutil-releas
|
||||||
for info in self.iter_proc_info():
|
for info in self.iter_proc_info():
|
||||||
diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.9.5/psutil/tests/test_linux.py
|
diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.9.5/psutil/tests/test_linux.py
|
||||||
--- psutil-release-5.9.5.orig/psutil/tests/test_linux.py 2023-08-04 06:14:41.080097504 -0500
|
--- psutil-release-5.9.5.orig/psutil/tests/test_linux.py 2023-08-04 06:14:41.080097504 -0500
|
||||||
+++ psutil-release-5.9.5/psutil/tests/test_linux.py 2023-08-04 06:38:25.302472625 -0500
|
+++ psutil-release-5.9.5/psutil/tests/test_linux.py 2023-08-04 08:32:44.666822057 -0500
|
||||||
@@ -257,7 +257,7 @@
|
@@ -257,7 +257,7 @@
|
||||||
psutil_value = psutil.virtual_memory().total
|
psutil_value = psutil.virtual_memory().total
|
||||||
self.assertEqual(cli_value, psutil_value)
|
self.assertEqual(cli_value, psutil_value)
|
||||||
|
@ -39,7 +39,15 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
def test_against_sysdev_cpu_online(self):
|
def test_against_sysdev_cpu_online(self):
|
||||||
with open("/sys/devices/system/cpu/online") as f:
|
with open("/sys/devices/system/cpu/online") as f:
|
||||||
value = f.read().strip()
|
value = f.read().strip()
|
||||||
@@ -707,7 +707,7 @@
|
@@ -700,14 +700,13 @@
|
||||||
|
value = int(value.split('-')[1]) + 1
|
||||||
|
self.assertEqual(psutil.cpu_count(), value)
|
||||||
|
|
||||||
|
- @unittest.skipIf(not os.path.exists("/sys/devices/system/cpu"),
|
||||||
|
- "/sys/devices/system/cpu does not exist")
|
||||||
|
+ @unittest.skip("Unreliable in mock on ppc64le")
|
||||||
|
def test_against_sysdev_cpu_num(self):
|
||||||
|
ls = os.listdir("/sys/devices/system/cpu")
|
||||||
count = len([x for x in ls if re.search(r"cpu\d+$", x) is not None])
|
count = len([x for x in ls if re.search(r"cpu\d+$", x) is not None])
|
||||||
self.assertEqual(psutil.cpu_count(), count)
|
self.assertEqual(psutil.cpu_count(), count)
|
||||||
|
|
||||||
|
@ -48,7 +56,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
def test_against_nproc(self):
|
def test_against_nproc(self):
|
||||||
num = int(sh("nproc --all"))
|
num = int(sh("nproc --all"))
|
||||||
self.assertEqual(psutil.cpu_count(logical=True), num)
|
self.assertEqual(psutil.cpu_count(logical=True), num)
|
||||||
@@ -752,7 +752,7 @@
|
@@ -752,7 +751,7 @@
|
||||||
assert m.called
|
assert m.called
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +65,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
class TestSystemCPUCountCores(PsutilTestCase):
|
class TestSystemCPUCountCores(PsutilTestCase):
|
||||||
|
|
||||||
@unittest.skipIf(not which("lscpu"), "lscpu utility not available")
|
@unittest.skipIf(not which("lscpu"), "lscpu utility not available")
|
||||||
@@ -784,7 +784,7 @@
|
@@ -784,7 +783,7 @@
|
||||||
@unittest.skipIf(not LINUX, "LINUX only")
|
@unittest.skipIf(not LINUX, "LINUX only")
|
||||||
class TestSystemCPUFrequency(PsutilTestCase):
|
class TestSystemCPUFrequency(PsutilTestCase):
|
||||||
|
|
||||||
|
@ -66,7 +74,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
def test_emulate_use_second_file(self):
|
def test_emulate_use_second_file(self):
|
||||||
# https://github.com/giampaolo/psutil/issues/981
|
# https://github.com/giampaolo/psutil/issues/981
|
||||||
def path_exists_mock(path):
|
def path_exists_mock(path):
|
||||||
@@ -798,7 +798,7 @@
|
@@ -798,7 +797,7 @@
|
||||||
create=True):
|
create=True):
|
||||||
assert psutil.cpu_freq()
|
assert psutil.cpu_freq()
|
||||||
|
|
||||||
|
@ -75,7 +83,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
def test_emulate_use_cpuinfo(self):
|
def test_emulate_use_cpuinfo(self):
|
||||||
# Emulate a case where /sys/devices/system/cpu/cpufreq* does not
|
# Emulate a case where /sys/devices/system/cpu/cpufreq* does not
|
||||||
# exist and /proc/cpuinfo is used instead.
|
# exist and /proc/cpuinfo is used instead.
|
||||||
@@ -923,7 +923,7 @@
|
@@ -923,7 +922,7 @@
|
||||||
self.assertEqual(freq.current, 200)
|
self.assertEqual(freq.current, 200)
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,7 +92,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
class TestSystemCPUStats(PsutilTestCase):
|
class TestSystemCPUStats(PsutilTestCase):
|
||||||
|
|
||||||
def test_ctx_switches(self):
|
def test_ctx_switches(self):
|
||||||
@@ -956,7 +956,7 @@
|
@@ -956,7 +955,7 @@
|
||||||
# =====================================================================
|
# =====================================================================
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +101,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
class TestSystemNetIfAddrs(PsutilTestCase):
|
class TestSystemNetIfAddrs(PsutilTestCase):
|
||||||
|
|
||||||
def test_ips(self):
|
def test_ips(self):
|
||||||
@@ -1350,7 +1350,7 @@
|
@@ -1350,7 +1349,7 @@
|
||||||
self.assertRaises(FileNotFoundError, finder.ask_sys_dev_block)
|
self.assertRaises(FileNotFoundError, finder.ask_sys_dev_block)
|
||||||
finder.ask_sys_class_block()
|
finder.ask_sys_class_block()
|
||||||
|
|
||||||
|
@ -102,7 +110,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
def test_comparisons(self):
|
def test_comparisons(self):
|
||||||
finder = RootFsDeviceFinder()
|
finder = RootFsDeviceFinder()
|
||||||
self.assertIsNotNone(finder.find())
|
self.assertIsNotNone(finder.find())
|
||||||
@@ -1373,11 +1373,13 @@
|
@@ -1373,11 +1372,13 @@
|
||||||
|
|
||||||
@unittest.skipIf(not which("findmnt"), "findmnt utility not available")
|
@unittest.skipIf(not which("findmnt"), "findmnt utility not available")
|
||||||
@unittest.skipIf(GITHUB_ACTIONS, "unsupported on GITHUB_ACTIONS")
|
@unittest.skipIf(GITHUB_ACTIONS, "unsupported on GITHUB_ACTIONS")
|
||||||
|
@ -116,7 +124,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
def test_disk_partitions_mocked(self):
|
def test_disk_partitions_mocked(self):
|
||||||
with mock.patch(
|
with mock.patch(
|
||||||
'psutil._pslinux.cext.disk_partitions',
|
'psutil._pslinux.cext.disk_partitions',
|
||||||
@@ -1513,6 +1515,7 @@
|
@@ -1513,6 +1514,7 @@
|
||||||
psutil._pslinux.boot_time)
|
psutil._pslinux.boot_time)
|
||||||
assert m.called
|
assert m.called
|
||||||
|
|
||||||
|
@ -124,7 +132,7 @@ diff -uNr psutil-release-5.9.5.orig/psutil/tests/test_linux.py psutil-release-5.
|
||||||
def test_users_mocked(self):
|
def test_users_mocked(self):
|
||||||
# Make sure ':0' and ':0.0' (returned by C ext) are converted
|
# Make sure ':0' and ':0.0' (returned by C ext) are converted
|
||||||
# to 'localhost'.
|
# to 'localhost'.
|
||||||
@@ -2275,6 +2278,7 @@
|
@@ -2275,6 +2277,7 @@
|
||||||
value = self.read_status_file("nonvoluntary_ctxt_switches:")
|
value = self.read_status_file("nonvoluntary_ctxt_switches:")
|
||||||
self.assertEqual(self.proc.num_ctx_switches().involuntary, value)
|
self.assertEqual(self.proc.num_ctx_switches().involuntary, value)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue