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

Method test_start_duplicate_handle

Lib/test/test_thread.py:325–338  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

323 handle._set_done()
324
325 def test_start_duplicate_handle(self):
326 lock = thread.allocate_lock()
327 lock.acquire()
328
329 def func():
330 lock.acquire()
331
332 handle = thread._ThreadHandle()
333 with threading_helper.wait_threads_exit():
334 thread.start_joinable_thread(func, handle=handle)
335 with self.assertRaisesRegex(RuntimeError, "thread already started"):
336 thread.start_joinable_thread(func, handle=handle)
337 lock.release()
338 handle.join()
339
340 def test_start_with_none_handle(self):
341 def func():

Callers

nothing calls this directly

Calls 4

assertRaisesRegexMethod · 0.80
acquireMethod · 0.45
releaseMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected