1
0
forked from pool/python-psutil

Accepting request 950795 from devel:languages:python

- Fix name of Patch4, it is skip-partitions-erros.patch
- Add skip-partitions-erros.patch skipping tests failing on Linux
  (gh#giampaolo/psutil#2043).

OBS-URL: https://build.opensuse.org/request/show/950795
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-psutil?expand=0&rev=64
This commit is contained in:
Dominique Leuenberger 2022-02-03 22:15:56 +00:00 committed by Git OBS Bridge
commit d6e5157bfa
5 changed files with 64 additions and 12 deletions

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Wed Feb 2 17:30:32 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Fix name of Patch4, it is skip-partitions-erros.patch
-------------------------------------------------------------------
Sun Jan 30 01:38:45 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Add skip-partitions-erros.patch skipping tests failing on Linux
(gh#giampaolo/psutil#2043).
-------------------------------------------------------------------
Mon Jan 10 22:51:40 UTC 2022 - Dirk Müller <dmueller@suse.com>

View File

@ -36,6 +36,8 @@ Patch1: skip-obs.patch
Patch2: skip_failing_tests.patch
# PATCH-FIX-SLE skip_rlimit_tests_on_python2.patch alarrosa@suse.com
Patch3: skip_rlimit_tests_on_python2.patch
# PATCH-FIX-UPSTREAM skip-partitions-erros.patch gh#giampaolo/psutil#2043 mcepl@suse.com
Patch4: skip-partitions-erros.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@ -89,7 +91,9 @@ export TRAVIS=1
march=`python3 -c "import platform ; print(platform.machine())"`
# Note test_fetch_all is a bit flaky, occasionally failing
%python_expand PYTHONPATH=build/lib.linux-${march}-%{$python_version}/ $python -Wa psutil/tests/runner.py
%{python_expand export PYTHONPATH=build/lib.linux-${march}-%{$python_version}/
$python -Wa psutil/tests/runner.py
}
%endif
%files %{python_files}

View File

@ -0,0 +1,33 @@
---
psutil/tests/test_linux.py | 2 ++
psutil/tests/test_misc.py | 1 +
2 files changed, 3 insertions(+)
--- a/psutil/tests/test_linux.py
+++ b/psutil/tests/test_linux.py
@@ -1288,6 +1288,7 @@ class TestRootFsDeviceFinder(PsutilTestC
self.assertRaises(FileNotFoundError, finder.ask_sys_dev_block)
finder.ask_sys_class_block()
+ @unittest.skip("Test doesn't work on Linux.")
@unittest.skipIf(GITHUB_ACTIONS, "unsupported on GITHUB_ACTIONS")
def test_comparisons(self):
finder = RootFsDeviceFinder()
@@ -1316,6 +1317,7 @@ class TestRootFsDeviceFinder(PsutilTestC
findmnt_value = sh("findmnt -o SOURCE -rn /")
self.assertEqual(psutil_value, findmnt_value)
+ @unittest.skip("Test doesn't work on Linux.")
def test_disk_partitions_mocked(self):
with mock.patch(
'psutil._pslinux.cext.disk_partitions',
--- a/psutil/tests/test_misc.py
+++ b/psutil/tests/test_misc.py
@@ -402,6 +402,7 @@ class TestMisc(PsutilTestCase):
reload_module(psutil)
self.assertIn("version conflict", str(cm.exception).lower())
+ @unittest.skip("Test doesn't work on Linux.")
def test_debug(self):
if PY3:
from io import StringIO

View File

@ -1,8 +1,10 @@
Index: psutil-5.7.3/psutil/tests/test_linux.py
===================================================================
--- psutil-5.7.3.orig/psutil/tests/test_linux.py
+++ psutil-5.7.3/psutil/tests/test_linux.py
@@ -1564,6 +1564,8 @@ class TestSensorsBattery(PsutilTestCase)
---
psutil/tests/test_linux.py | 4 ++++
1 file changed, 4 insertions(+)
--- a/psutil/tests/test_linux.py
+++ b/psutil/tests/test_linux.py
@@ -1614,6 +1614,8 @@ class TestSensorsBattery(PsutilTestCase)
self.assertIsNone(psutil.sensors_battery().power_plugged)
assert m.called
@ -11,7 +13,7 @@ Index: psutil-5.7.3/psutil/tests/test_linux.py
def test_emulate_energy_full_0(self):
# Emulate a case where energy_full files returns 0.
with mock_open_content(
@@ -1571,6 +1573,8 @@ class TestSensorsBattery(PsutilTestCase)
@@ -1621,6 +1623,8 @@ class TestSensorsBattery(PsutilTestCase)
self.assertEqual(psutil.sensors_battery().percent, 0)
assert m.called

View File

@ -1,7 +1,9 @@
Index: psutil-5.8.0/psutil/tests/test_process.py
===================================================================
--- psutil-5.8.0.orig/psutil/tests/test_process.py
+++ psutil-5.8.0/psutil/tests/test_process.py
---
psutil/tests/test_process.py | 6 ++++++
1 file changed, 6 insertions(+)
--- a/psutil/tests/test_process.py
+++ b/psutil/tests/test_process.py
@@ -416,6 +416,7 @@ class TestProcess(PsutilTestCase):
p.ionice(init)
@ -42,7 +44,7 @@ Index: psutil-5.8.0/psutil/tests/test_process.py
def test_rlimit_infinity_value(self):
# RLIMIT_FSIZE should be RLIM_INFINITY, which will be a really
# big number on a platform with large file support. On these
@@ -1270,6 +1275,7 @@ class TestProcess(PsutilTestCase):
@@ -1276,6 +1281,7 @@ class TestProcess(PsutilTestCase):
self.assertEqual(normcase(p.exe()), normcase(PYTHON_EXE))
@unittest.skipIf(not POSIX, 'POSIX only')