Back to index

python3.2  3.2.2
Public Member Functions
test.test_capi.EmbeddingTest Class Reference

List of all members.

Public Member Functions

def test_subinterps

Detailed Description

Definition at line 146 of file test_capi.py.


Member Function Documentation

Definition at line 151 of file test_capi.py.

00151 
00152     def test_subinterps(self):
00153         # XXX only tested under Unix checkouts
00154         basepath = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
00155         oldcwd = os.getcwd()
00156         # This is needed otherwise we get a fatal error:
00157         # "Py_Initialize: Unable to get the locale encoding
00158         # LookupError: no codec search functions registered: can't find encoding"
00159         os.chdir(basepath)
00160         try:
00161             exe = os.path.join(basepath, "Modules", "_testembed")
00162             if not os.path.exists(exe):
00163                 self.skipTest("%r doesn't exist" % exe)
00164             p = subprocess.Popen([exe],
00165                                  stdout=subprocess.PIPE,
00166                                  stderr=subprocess.PIPE)
00167             (out, err) = p.communicate()
00168             self.assertEqual(p.returncode, 0,
00169                              "bad returncode %d, stderr is %r" %
00170                              (p.returncode, err))
00171             if support.verbose:
00172                 print()
00173                 print(out.decode('latin1'))
00174                 print(err.decode('latin1'))
00175         finally:
00176             os.chdir(oldcwd)
00177 

Here is the call graph for this function:


The documentation for this class was generated from the following file: