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

Method test_run_code

Lib/test/test_runpy.py:158–165  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

156 """Unit tests for runpy._run_code and runpy._run_module_code"""
157
158 def test_run_code(self):
159 expected_ns = example_namespace.copy()
160 expected_ns.update({
161 "__loader__": None,
162 })
163 def create_ns(init_globals):
164 return _run_code(example_source, {}, init_globals)
165 self.check_code_execution(create_ns, expected_ns)
166
167 def test_run_module_code(self):
168 mod_name = "<Nonsense>"

Callers

nothing calls this directly

Calls 3

check_code_executionMethod · 0.80
copyMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected