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

Method test_pre_initialization_api

Lib/test/test_embed.py:316–333  ·  view source on GitHub ↗

Checks some key parts of the C-API that need to work before the runtime is initialized (via Py_Initialize()).

(self)

Source from the content-addressed store, hash-verified

314 self.assertEqual(out.strip(), expected_output)
315
316 def test_pre_initialization_api(self):
317 """
318 Checks some key parts of the C-API that need to work before the runtime
319 is initialized (via Py_Initialize()).
320 """
321 env = dict(os.environ, PYTHONPATH=os.pathsep.join(sys.path))
322 out, err = self.run_embedded_interpreter("test_pre_initialization_api", env=env)
323 if support.verbose > 1:
324 print()
325 print(out)
326 print(err)
327 if MS_WINDOWS:
328 expected_path = self.test_exe
329 else:
330 expected_path = os.path.join(os.getcwd(), "_testembed")
331 expected_output = f"sys.executable: {expected_path}\n"
332 self.assertIn(expected_output, out)
333 self.assertEqual(err, '')
334
335 def test_pre_initialization_sys_options(self):
336 """

Callers

nothing calls this directly

Calls 4

assertInMethod · 0.80
joinMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected