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

Method test_in_thread

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

Source from the content-addressed store, hash-verified

528 self.assertEqual(out, 'it worked!')
529
530 def test_in_thread(self):
531 script, file = _captured_script('print("it worked!", end="")')
532 with file:
533 def f():
534 _interpreters.run_string(self.id, script)
535
536 t = threading.Thread(target=f)
537 t.start()
538 t.join()
539 out = file.read()
540
541 self.assertEqual(out, 'it worked!')
542
543 def test_create_thread(self):
544 subinterp = _interpreters.create()

Callers

nothing calls this directly

Calls 5

startMethod · 0.95
joinMethod · 0.95
_captured_scriptFunction · 0.70
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected