MCPcopy Index your code
hub / github.com/python/cpython / test_wmi_query_threads

Method test_wmi_query_threads

Lib/test/test_wmi.py:83–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

81 pass
82
83 def test_wmi_query_threads(self):
84 from concurrent.futures import ThreadPoolExecutor
85 query = "SELECT ProcessId FROM Win32_Process WHERE ProcessId < 1000"
86 with ThreadPoolExecutor(4) as pool:
87 task = [pool.submit(wmi_exec_query, query) for _ in range(32)]
88 for t in task:
89 self.assertRegex(t.result(), "ProcessId=")

Callers

nothing calls this directly

Calls 4

ThreadPoolExecutorClass · 0.90
assertRegexMethod · 0.80
submitMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected