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

Method setUp

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

Source from the content-addressed store, hash-verified

85
86class EmbeddingTestsMixin:
87 def setUp(self):
88 exename = "_testembed"
89 builddir = os.path.dirname(sys.executable)
90 if MS_WINDOWS:
91 ext = ("_d" if debug_build(sys.executable) else "") + ".exe"
92 exename += ext
93 exepath = builddir
94 else:
95 exepath = os.path.join(builddir, 'Programs')
96 self.test_exe = exe = os.path.join(exepath, exename)
97 if not os.path.exists(exe):
98 self.skipTest("%r doesn't exist" % exe)
99 # This is needed otherwise we get a fatal error:
100 # "Py_Initialize: Unable to get the locale encoding
101 # LookupError: no codec search functions registered: can't find encoding"
102 self.oldcwd = os.getcwd()
103 os.chdir(builddir)
104
105 def tearDown(self):
106 os.chdir(self.oldcwd)

Callers

nothing calls this directly

Calls 5

debug_buildFunction · 0.85
skipTestMethod · 0.80
dirnameMethod · 0.45
joinMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected