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

Method test_create_thread

Lib/test/test__interpreters.py:543–558  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

541 self.assertEqual(out, 'it worked!')
542
543 def test_create_thread(self):
544 subinterp = _interpreters.create()
545 script, file = _captured_script("""
546 import threading
547 def f():
548 print('it worked!', end='')
549
550 t = threading.Thread(target=f)
551 t.start()
552 t.join()
553 """)
554 with file:
555 _interpreters.run_string(subinterp, script)
556 out = file.read()
557
558 self.assertEqual(out, 'it worked!')
559
560 def test_create_daemon_thread(self):
561 with self.subTest('isolated'):

Callers

nothing calls this directly

Calls 4

_captured_scriptFunction · 0.70
createMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected