| LEFT | RIGHT |
| (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 Loading... |
| 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 Loading... |
| 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") |
| LEFT | RIGHT |