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

Delta Between Two Patch Sets: Lib/packaging/tests/support.py

Issue 3754: cross-compilation support for python build
Left Patch Set: Created 2 years, 1 month ago
Right Patch Set: Created 11 months, 2 weeks 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:
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/distutils/README ('k') | Lib/sysconfig.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 """Support code for packaging test cases. 1 """Support code for packaging test cases.
2 2
3 *This module should not be considered public: its content and API may 3 *This module should not be considered public: its content and API may
4 change in incompatible ways.* 4 change in incompatible ways.*
5 5
6 A few helper classes are provided: LoggingCatcher, TempdirManager and 6 A few helper classes are provided: LoggingCatcher, TempdirManager and
7 EnvironRestorer. They are written to be used as mixins:: 7 EnvironRestorer. They are written to be used as mixins::
8 8
9 from packaging.tests import unittest 9 from packaging.tests import unittest
10 from packaging.tests.support import LoggingCatcher 10 from packaging.tests.support import LoggingCatcher
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 the test will be skipped. Errors during copy are not caught. 332 the test will be skipped. Errors during copy are not caught.
333 """ 333 """
334 filename = _get_xxmodule_path() 334 filename = _get_xxmodule_path()
335 if filename is None: 335 if filename is None:
336 raise unittest.SkipTest('cannot find xxmodule.c') 336 raise unittest.SkipTest('cannot find xxmodule.c')
337 shutil.copy(filename, directory) 337 shutil.copy(filename, directory)
338 338
339 339
340 def _get_xxmodule_path(): 340 def _get_xxmodule_path():
341 if sysconfig.is_python_build(): 341 if sysconfig.is_python_build():
342 srcdir = sysconfig.get_config_var('projectbase') 342 srcdir = sysconfig.get_config_var('srcdir')
343 path = os.path.join(os.getcwd(), srcdir, 'Modules', 'xxmodule.c') 343 path = os.path.join(os.getcwd(), srcdir, 'Modules', 'xxmodule.c')
344 else: 344 else:
345 path = os.path.join(os.path.dirname(__file__), 'xxmodule.c') 345 path = os.path.join(os.path.dirname(__file__), 'xxmodule.c')
346 if os.path.exists(path): 346 if os.path.exists(path):
347 return path 347 return path
348 348
349 349
350 def fixup_build_ext(cmd): 350 def fixup_build_ext(cmd):
351 """Function needed to make build_ext tests pass. 351 """Function needed to make build_ext tests pass.
352 352
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 391
392 392
393 try: 393 try:
394 from test.support import skip_unless_symlink 394 from test.support import skip_unless_symlink
395 except ImportError: 395 except ImportError:
396 skip_unless_symlink = unittest.skip( 396 skip_unless_symlink = unittest.skip(
397 'requires test.support.skip_unless_symlink') 397 'requires test.support.skip_unless_symlink')
398 398
399 skip_2to3_optimize = unittest.skipIf(sys.flags.optimize, 399 skip_2to3_optimize = unittest.skipIf(sys.flags.optimize,
400 "2to3 doesn't work under -O") 400 "2to3 doesn't work under -O")
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7