summaryrefslogtreecommitdiff
path: root/Lib/test/test_concurrent_futures.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2014-09-02 10:39:18 -0700
committerGuido van Rossum <guido@python.org>2014-09-02 10:39:18 -0700
commitcfd4661e78bd2256caaf80cf29588e5119e787b0 (patch)
tree507008e6f9977acff6a347cc085119c6a7917164 /Lib/test/test_concurrent_futures.py
parent8257b6283e3ea41f5746835871dedcb00139bdfe (diff)
downloadcpython-git-cfd4661e78bd2256caaf80cf29588e5119e787b0.tar.gz
Closes #21527: Add default number of workers to ThreadPoolExecutor. (Claudiu Popa.)
Diffstat (limited to 'Lib/test/test_concurrent_futures.py')
-rw-r--r--Lib/test/test_concurrent_futures.py6
1 files changed, 6 insertions, 0 deletions
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):