diff --git a/numexpr/tests/test_numexpr.py b/numexpr/tests/test_numexpr.py index bb5b177..82e702b 100644 --- a/numexpr/tests/test_numexpr.py +++ b/numexpr/tests/test_numexpr.py @@ -41,6 +41,7 @@ double = np.double long = int +MAX_THREADS = 8 class test_numexpr(TestCase): @@ -1164,14 +1165,14 @@ def test_omp_num_threads_empty_string(self): if 'sparc' in platform.machine(): self.assertEqual(1, numexpr._init_num_threads()) else: - self.assertEqual(detect_number_of_cores(), numexpr._init_num_threads()) + self.assertEqual(min(detect_number_of_cores(), MAX_THREADS), numexpr._init_num_threads()) def test_numexpr_max_threads_empty_string(self): with _environment('NUMEXPR_MAX_THREADS', ''): if 'sparc' in platform.machine(): self.assertEqual(1, numexpr._init_num_threads()) else: - self.assertEqual(detect_number_of_cores(), numexpr._init_num_threads()) + self.assertEqual(min(detect_number_of_cores(), MAX_THREADS), numexpr._init_num_threads()) def test_vml_threads_round_trip(self): n_threads = 3