1
0
forked from pool/python-psutil

- Add skip_failing_tests.patch to skip tests failing because of

incomplete emulation of the environment in osc build
  environment (gh#giampaolo/psutil#1635).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=117
This commit is contained in:
Matej Cepl 2020-08-21 15:27:58 +00:00 committed by Git OBS Bridge
parent a38d8b3042
commit e33132c9a2
3 changed files with 36 additions and 0 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Aug 21 15:27:11 UTC 2020 - Matej Cepl <mcepl@suse.com>
- Add skip_failing_tests.patch to skip tests failing because of
incomplete emulation of the environment in osc build
environment (gh#giampaolo/psutil#1635).
-------------------------------------------------------------------
Sat Mar 14 07:25:43 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -32,6 +32,9 @@ URL: https://github.com/giampaolo/psutil
Source: https://files.pythonhosted.org/packages/source/p/psutil/psutil-%{version}.tar.gz
Patch0: skip-flaky-i586.patch
Patch1: skip-obs.patch
# PATCH-FIX-UPSTREAM skip_failing_tests.patch gh#giampaolo/psutil#1635 mcepl@suse.com
# skip tests failing because of incomplete emulation of the environment in osc build
Patch2: skip_failing_tests.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes

26
skip_failing_tests.patch Normal file
View File

@ -0,0 +1,26 @@
--- a/psutil/tests/test_linux.py
+++ b/psutil/tests/test_linux.py
@@ -1500,6 +1500,7 @@ class TestSensorsBattery(unittest.TestCa
self.assertIsNone(psutil.sensors_battery().power_plugged)
assert m.called
+ @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_now'))
def test_emulate_no_base_files(self):
# Emulate a case where base metrics files are not present,
# in which case we're supposed to get None.
@@ -1511,6 +1512,7 @@ class TestSensorsBattery(unittest.TestCa
IOError(errno.ENOENT, "")):
self.assertIsNone(psutil.sensors_battery())
+ @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'))
def test_emulate_energy_full_0(self):
# Emulate a case where energy_full files returns 0.
with mock_open_content(
@@ -1518,6 +1520,7 @@ class TestSensorsBattery(unittest.TestCa
self.assertEqual(psutil.sensors_battery().percent, 0)
assert m.called
+ @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'))
def test_emulate_energy_full_not_avail(self):
# Emulate a case where energy_full file does not exist.
# Expected fallback on /capacity.