We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17d2622 commit 7aef2fdCopy full SHA for 7aef2fd
pydra/engine/tests/test_helpers.py
@@ -1,5 +1,6 @@
1
import os
2
from pathlib import Path
3
+import platform
4
5
import pytest
6
import cloudpickle as cp
@@ -170,10 +171,14 @@ def test_get_available_cpus():
170
171
import psutil
172
173
has_psutil = True
- assert get_available_cpus() == len(psutil.Process().cpu_affinity())
174
except ImportError:
175
has_psutil = False
176
+
177
if hasattr(os, "sched_getaffinity"):
178
assert get_available_cpus() == len(os.sched_getaffinity(0))
- elif not has_psutil:
179
180
+ if has_psutil and platform.system().lower() != "darwin":
181
+ assert get_available_cpus() == len(psutil.Process().cpu_affinity())
182
183
+ if platform.system().lower() == "darwin":
184
assert get_available_cpus() == os.cpu_count()
0 commit comments