summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-05-26 13:21:31 +0200
committerGitHub <noreply@github.com>2020-05-26 13:21:31 +0200
commit3c209c19acbfe91f237fae18a57156fafef3d2c7 (patch)
tree2295177d7d02a033ac027487861989308f950cfd
parent23662e6e5b9476fa33285729494657fb3ed18a80 (diff)
downloadpsutil-3c209c19acbfe91f237fae18a57156fafef3d2c7.tar.gz
Sort results in test_cpu_affinity_all_combinations (#1769)
Fix test_cpu_affinity_all_combinations to permit any CPU order in results. This fixes test failure due to affinity being reported out of order: ====================================================================== FAIL: psutil.tests.test_process.TestProcess.test_cpu_affinity_all_combinations ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/psutil/psutil/tests/test_process.py", line 940, in test_cpu_affinity_all_combinations self.assertEqual(p.cpu_affinity(), combo) AssertionError: Lists differ: [8, 1] != [1, 8] First differing element 0: 8 1 - [8, 1] + [1, 8] ----------------------------------------------------------------------
-rwxr-xr-xpsutil/tests/test_process.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py
index a0b21c6e..e3394799 100755
--- a/psutil/tests/test_process.py
+++ b/psutil/tests/test_process.py
@@ -937,7 +937,7 @@ class TestProcess(PsutilTestCase):
for combo in combos:
p.cpu_affinity(combo)
- self.assertEqual(p.cpu_affinity(), combo)
+ self.assertEqual(sorted(p.cpu_affinity()), sorted(combo))
# TODO: #595
@unittest.skipIf(BSD, "broken on BSD")