From 5e5ceac8c59cb5401b2a6352b02f0d6792d6d1e0 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Fri, 13 Oct 2023 15:10:31 +0100 Subject: [PATCH] update test --- tests/tests/test_unit/test_general/test_system.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/tests/test_unit/test_general/test_system.py b/tests/tests/test_unit/test_general/test_system.py index 4d7bf23..20bbd47 100644 --- a/tests/tests/test_unit/test_general/test_system.py +++ b/tests/tests/test_unit/test_general/test_system.py @@ -88,10 +88,14 @@ def test_check_path_in_dir(): def test_get_num_processes(): - assert os.cpu_count() == system.get_num_processes(min_free_cpu_cores=0) + cpu_count = 10 + with patch( + "brainglobe_utils.general.system.psutil.cpu_count", + return_value=cpu_count, + ): + assert system.get_num_processes(min_free_cpu_cores=0) == cpu_count -## orig def test_max_processes(): max_proc = 5 correct_n = min(os.cpu_count(), max_proc)