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

Method test_audit_run_interactivehook

Lib/test/test_embed.py:1957–1968  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1955 returncode=1)
1956
1957 def test_audit_run_interactivehook(self):
1958 startup = os.path.join(self.oldcwd, os_helper.TESTFN) + ".py"
1959 with open(startup, "w", encoding="utf-8") as f:
1960 print("import sys", file=f)
1961 print("sys.__interactivehook__ = lambda: None", file=f)
1962 try:
1963 env = {**remove_python_envvars(), "PYTHONSTARTUP": startup}
1964 self.run_embedded_interpreter("test_audit_run_interactivehook",
1965 timeout=support.SHORT_TIMEOUT,
1966 returncode=10, env=env)
1967 finally:
1968 os.unlink(startup)
1969
1970 def test_audit_run_startup(self):
1971 startup = os.path.join(self.oldcwd, os_helper.TESTFN) + ".py"

Callers

nothing calls this directly

Calls 5

remove_python_envvarsFunction · 0.85
openFunction · 0.50
joinMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected