Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(48179)

Unified Diff: Lib/test/test_concurrent_futures.py

Issue 27664: Allow specifying prefix for thread name in concurrent.futures.ThreadPoolExecutor
Patch Set: Created 3 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/concurrent/futures/thread.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_concurrent_futures.py
+++ b/Lib/test/test_concurrent_futures.py
@@ -154,6 +154,17 @@ class ThreadPoolShutdownTest(ThreadPoolM
for t in threads:
t.join()
+ def test_thread_names(self):
+ executor = futures.ThreadPoolExecutor(
+ max_workers=5, thread_name_prefix='SpecialPool')
+ executor.map(abs, range(-5, 5))
+ threads = executor._threads
+ del executor
+
+ for t in threads:
+ self.assertRegex(t.name, '^SpecialPool_[0-4]$')
+ t.join()
+
class ProcessPoolShutdownTest(ProcessPoolMixin, ExecutorShutdownTest, unittest.TestCase):
def _prime_executor(self):
« no previous file with comments | « Lib/concurrent/futures/thread.py ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+