Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(11)

Side by Side Diff: Lib/test/test_capi.py

Issue 3871: cross and native build of python for mingw32 with distutils
Patch Set: Created 7 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/sysconfig.py ('k') | Lib/test/test_curses.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Run the _testcapi module tests (tests for the Python/C API): by defn, 1 # Run the _testcapi module tests (tests for the Python/C API): by defn,
2 # these are all functions _testcapi exports whose name begins with 'test_'. 2 # these are all functions _testcapi exports whose name begins with 'test_'.
3 3
4 from __future__ import with_statement 4 from __future__ import with_statement
5 import os 5 import os
6 import pickle 6 import pickle
7 import random 7 import random
8 import subprocess 8 import subprocess
9 import sys 9 import sys
10 import time 10 import time
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 # Bug #6012 211 # Bug #6012
212 class Test6012(unittest.TestCase): 212 class Test6012(unittest.TestCase):
213 def test(self): 213 def test(self):
214 self.assertEqual(_testcapi.argparsing("Hello", "World"), 1) 214 self.assertEqual(_testcapi.argparsing("Hello", "World"), 1)
215 215
216 216
217 class EmbeddingTest(unittest.TestCase): 217 class EmbeddingTest(unittest.TestCase):
218 218
219 @unittest.skipIf( 219 @unittest.skipIf(
220 sys.platform.startswith('win'), 220 sys.platform.startswith('win') and sys.version.find('GCC') < 0,
221 "test doesn't work under Windows") 221 "test doesn't work with MSVC")
222 def test_subinterps(self): 222 def test_subinterps(self):
223 # XXX only tested under Unix checkouts 223 # XXX only tested under Posix checkouts
224 basepath = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) 224 basepath = support.SAVEDCWD
225 oldcwd = os.getcwd() 225 oldcwd = os.getcwd()
226 # This is needed otherwise we get a fatal error: 226 # This is needed otherwise we get a fatal error:
227 # "Py_Initialize: Unable to get the locale encoding 227 # "Py_Initialize: Unable to get the locale encoding
228 # LookupError: no codec search functions registered: can't find encoding " 228 # LookupError: no codec search functions registered: can't find encoding "
229 os.chdir(basepath) 229 os.chdir(basepath)
230 try: 230 try:
231 exe = os.path.join(basepath, "Modules", "_testembed") 231 from distutils.spawn import find_executable
232 if not os.path.exists(exe): 232 exe = find_executable("_testembed", basepath)
233 self.skipTest("%r doesn't exist" % exe) 233 if not exe:
234 self.skipTest("_testembed executable not found")
234 p = subprocess.Popen([exe], 235 p = subprocess.Popen([exe],
235 stdout=subprocess.PIPE, 236 stdout=subprocess.PIPE,
236 stderr=subprocess.PIPE) 237 stderr=subprocess.PIPE)
237 (out, err) = p.communicate() 238 (out, err) = p.communicate()
238 self.assertEqual(p.returncode, 0, 239 self.assertEqual(p.returncode, 0,
239 "bad returncode %d, stderr is %r" % 240 "bad returncode %d, stderr is %r" %
240 (p.returncode, err)) 241 (p.returncode, err))
241 if support.verbose: 242 if support.verbose:
242 print() 243 print()
243 print(out.decode('latin1')) 244 print(out.decode('latin1'))
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 if threading: 360 if threading:
360 import time 361 import time
361 TestThreadState() 362 TestThreadState()
362 t = threading.Thread(target=TestThreadState) 363 t = threading.Thread(target=TestThreadState)
363 t.start() 364 t.start()
364 t.join() 365 t.join()
365 366
366 367
367 if __name__ == "__main__": 368 if __name__ == "__main__":
368 test_main() 369 test_main()
OLDNEW
« no previous file with comments | « Lib/sysconfig.py ('k') | Lib/test/test_curses.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+