diff --git a/python-psutil-test-sum-floats-via-almost-equal.patch b/python-psutil-test-sum-floats-via-almost-equal.patch new file mode 100644 index 0000000..e7e40dd --- /dev/null +++ b/python-psutil-test-sum-floats-via-almost-equal.patch @@ -0,0 +1,22 @@ +diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py +index 3b787ee..db22245 100755 +--- a/psutil/tests/test_system.py ++++ b/psutil/tests/test_system.py +@@ -346,7 +346,7 @@ class TestCpuAPIs(PsutilTestCase): + self.assertIsInstance(cp_time, float) + self.assertGreaterEqual(cp_time, 0.0) + total += cp_time +- self.assertEqual(total, sum(times)) ++ self.assertAlmostEqual(total, sum(times)) + str(times) + # CPU times are always supposed to increase over time + # or at least remain the same and that's because time +@@ -385,7 +385,7 @@ class TestCpuAPIs(PsutilTestCase): + self.assertIsInstance(cp_time, float) + self.assertGreaterEqual(cp_time, 0.0) + total += cp_time +- self.assertEqual(total, sum(times)) ++ self.assertAlmostEqual(total, sum(times)) + str(times) + self.assertEqual(len(psutil.cpu_times(percpu=True)[0]), + len(psutil.cpu_times(percpu=False))) diff --git a/python-psutil.spec b/python-psutil.spec index b25ca20..2c1eeb9 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -13,6 +13,10 @@ Source0: %{url}/archive/release-%{version}/%{srcname}-%{version}.tar.gz # skip 2 tests that fail in mock chroots # Patch0: python-psutil-skip-tests-in-mock.patch +# +# avoid: AssertionError: 7883822.420000001 != 7883822.42 +# +Patch1: python-psutil-test-sum-floats-via-almost-equal.patch BuildRequires: gcc BuildRequires: grep