python-psutil/skip-obs.patch
Tomáš Chvátal a38d8b3042 - Update to 5.7.0:
* Various fixes to build with updated kernel/etc.
- Remove merged patch pr_1665.patch and pr_1364.patch
- Update patch skip-obs.patch
- Remove skip-test-missing-warnings.patch as it can be fixed by
  properly calling the tests

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=115
2020-03-14 07:46:58 +00:00

124 lines
5.1 KiB
Diff

Index: psutil-5.7.0/psutil/tests/__init__.py
===================================================================
--- psutil-5.7.0.orig/psutil/tests/__init__.py
+++ psutil-5.7.0/psutil/tests/__init__.py
@@ -174,7 +174,7 @@ HAS_SENSORS_BATTERY = hasattr(psutil, "s
try:
HAS_BATTERY = HAS_SENSORS_BATTERY and bool(psutil.sensors_battery())
except Exception:
- HAS_BATTERY = True
+ HAS_BATTERY = False
HAS_SENSORS_FANS = hasattr(psutil, "sensors_fans")
HAS_SENSORS_TEMPERATURES = hasattr(psutil, "sensors_temperatures")
HAS_THREADS = hasattr(psutil.Process, "threads")
Index: psutil-5.7.0/psutil/tests/test_misc.py
===================================================================
--- psutil-5.7.0.orig/psutil/tests/test_misc.py
+++ psutil-5.7.0/psutil/tests/test_misc.py
@@ -684,7 +684,7 @@ class TestScripts(unittest.TestCase):
src = f.read()
ast.parse(src)
- def test_coverage(self):
+ def _test_coverage(self):
# make sure all example scripts have a test method defined
meths = dir(self)
for name in os.listdir(SCRIPTS_DIR):
@@ -702,7 +702,7 @@ class TestScripts(unittest.TestCase):
if not stat.S_IXUSR & os.stat(path)[stat.ST_MODE]:
self.fail('%r is not executable' % path)
- def test_disk_usage(self):
+ def _test_disk_usage(self):
self.assert_stdout('disk_usage.py')
def test_free(self):
@@ -783,6 +783,8 @@ class TestScripts(unittest.TestCase):
def test_battery(self):
self.assert_stdout('battery.py')
+ @unittest.skipIf(not HAS_SENSORS_BATTERY, "not supported")
+ @unittest.skipIf(not HAS_BATTERY, "no battery")
def test_sensors(self):
self.assert_stdout('sensors.py')
Index: psutil-5.7.0/psutil/tests/test_linux.py
===================================================================
--- psutil-5.7.0.orig/psutil/tests/test_linux.py
+++ psutil-5.7.0/psutil/tests/test_linux.py
@@ -636,7 +636,7 @@ class TestSystemCPUCountLogical(unittest
self.assertEqual(psutil.cpu_count(logical=True), num)
@unittest.skipIf(not which("lscpu"), "lscpu utility not available")
- def test_against_lscpu(self):
+ def _test_against_lscpu(self):
out = sh("lscpu -p")
num = len([x for x in out.split('\n') if not x.startswith('#')])
self.assertEqual(psutil.cpu_count(logical=True), num)
@@ -679,7 +679,7 @@ class TestSystemCPUCountLogical(unittest
class TestSystemCPUCountPhysical(unittest.TestCase):
@unittest.skipIf(not which("lscpu"), "lscpu utility not available")
- def test_against_lscpu(self):
+ def _test_against_lscpu(self):
out = sh("lscpu -p")
core_ids = set()
for line in out.split('\n'):
@@ -1008,7 +1008,7 @@ class TestSystemDiskPartitions(unittest.
@unittest.skipIf(not hasattr(os, 'statvfs'), "os.statvfs() not available")
@skip_on_not_implemented()
- def test_against_df(self):
+ def _test_against_df(self):
# test psutil.disk_usage() and psutil.disk_partitions()
# against "df -a"
def df(path):
@@ -1183,7 +1183,7 @@ class TestSystemDiskIoCounters(unittest.
self.assertEqual(ret.read_count, 1)
self.assertEqual(ret.write_count, 5)
- def test_emulate_use_sysfs(self):
+ def _test_emulate_use_sysfs(self):
def exists(path):
if path == '/proc/diskstats':
return False
Index: psutil-5.7.0/psutil/tests/test_posix.py
===================================================================
--- psutil-5.7.0.orig/psutil/tests/test_posix.py
+++ psutil-5.7.0/psutil/tests/test_posix.py
@@ -414,7 +414,7 @@ class TestSystemAPIs(unittest.TestCase):
# AIX can return '-' in df output instead of numbers, e.g. for /proc
@unittest.skipIf(AIX, "unreliable on AIX")
- def test_disk_usage(self):
+ def _test_disk_usage(self):
def df(device):
out = sh("df -k %s" % device).strip()
line = out.split('\n')[1]
Index: psutil-5.7.0/psutil/tests/test_contracts.py
===================================================================
--- psutil-5.7.0.orig/psutil/tests/test_contracts.py
+++ psutil-5.7.0/psutil/tests/test_contracts.py
@@ -114,7 +114,7 @@ class TestAvailSystemAPIs(unittest.TestC
def test_win_service_get(self):
self.assertEqual(hasattr(psutil, "win_service_get"), WINDOWS)
- def test_cpu_freq(self):
+ def _test_cpu_freq(self):
linux = (LINUX and
(os.path.exists("/sys/devices/system/cpu/cpufreq") or
os.path.exists("/sys/devices/system/cpu/cpu0/cpufreq")))
Index: psutil-5.7.0/psutil/tests/test_system.py
===================================================================
--- psutil-5.7.0.orig/psutil/tests/test_system.py
+++ psutil-5.7.0/psutil/tests/test_system.py
@@ -604,7 +604,7 @@ class TestDiskAPIs(unittest.TestCase):
def test_disk_usage_bytes(self):
psutil.disk_usage(b'.')
- def test_disk_partitions(self):
+ def _test_disk_partitions(self):
# all = False
ls = psutil.disk_partitions(all=False)
# on travis we get: