Skip to content

Commit 7aef2fd

Browse files
committed
test for cpu count specifically on darwin
1 parent 17d2622 commit 7aef2fd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pydra/engine/tests/test_helpers.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
from pathlib import Path
3+
import platform
34

45
import pytest
56
import cloudpickle as cp
@@ -170,10 +171,14 @@ def test_get_available_cpus():
170171
import psutil
171172

172173
has_psutil = True
173-
assert get_available_cpus() == len(psutil.Process().cpu_affinity())
174174
except ImportError:
175175
has_psutil = False
176+
176177
if hasattr(os, "sched_getaffinity"):
177178
assert get_available_cpus() == len(os.sched_getaffinity(0))
178-
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":
179184
assert get_available_cpus() == os.cpu_count()

0 commit comments

Comments
 (0)