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

Method test_os_exec

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

Source from the content-addressed store, hash-verified

613 )
614
615 def test_os_exec(self):
616 expected = 'spam spam spam spam spam'
617 subinterp = _interpreters.create()
618 script, file = _captured_script(f"""
619 import os, sys
620 try:
621 os.execl(sys.executable)
622 except RuntimeError:
623 print('{expected}', end='')
624 """)
625 with file:
626 _interpreters.run_string(subinterp, script)
627 out = file.read()
628
629 self.assertEqual(out, expected)
630
631 @support.requires_fork()
632 def test_fork(self):

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