From cfd4661e78bd2256caaf80cf29588e5119e787b0 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 2 Sep 2014 10:39:18 -0700 Subject: Closes #21527: Add default number of workers to ThreadPoolExecutor. (Claudiu Popa.) --- Lib/test/test_concurrent_futures.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Lib/test/test_concurrent_futures.py') diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index 83184c3267..11560e65ac 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -11,6 +11,7 @@ test.support.import_module('threading') from test.script_helper import assert_python_ok +import os import sys import threading import time @@ -444,6 +445,11 @@ class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest, unittest.TestCase): self.executor.shutdown(wait=True) self.assertCountEqual(finished, range(10)) + def test_default_workers(self): + executor = self.executor_type() + self.assertEqual(executor._max_workers, + (os.cpu_count() or 1) * 5) + class ProcessPoolExecutorTest(ProcessPoolMixin, ExecutorTest, unittest.TestCase): def test_killed_child(self): -- cgit v1.2.1