(self)
| 1603 | |
| 1604 | @unittest.skipIf(MS_WINDOWS, 'See test_init_pybuilddir_win32') |
| 1605 | def test_init_pybuilddir(self): |
| 1606 | # Test path configuration with pybuilddir.txt configuration file |
| 1607 | |
| 1608 | with self.tmpdir_with_python() as tmpdir: |
| 1609 | # pybuilddir.txt is a sub-directory relative to the current |
| 1610 | # directory (tmpdir) |
| 1611 | vpath = sysconfig.get_config_var("VPATH") or '' |
| 1612 | subdir = 'libdir' |
| 1613 | libdir = os.path.join(tmpdir, subdir) |
| 1614 | # The stdlib dir is dirname(executable) + VPATH + 'Lib' |
| 1615 | stdlibdir = os.path.normpath(os.path.join(tmpdir, vpath, 'Lib')) |
| 1616 | os.mkdir(libdir) |
| 1617 | |
| 1618 | filename = os.path.join(tmpdir, 'pybuilddir.txt') |
| 1619 | with open(filename, "w", encoding="utf8") as fp: |
| 1620 | fp.write(subdir) |
| 1621 | |
| 1622 | module_search_paths = self.module_search_paths() |
| 1623 | module_search_paths[-2] = stdlibdir |
| 1624 | module_search_paths[-1] = libdir |
| 1625 | |
| 1626 | executable = self.test_exe |
| 1627 | config = { |
| 1628 | 'base_exec_prefix': sysconfig.get_config_var("exec_prefix"), |
| 1629 | 'base_prefix': sysconfig.get_config_var("prefix"), |
| 1630 | 'base_executable': executable, |
| 1631 | 'executable': executable, |
| 1632 | 'module_search_paths': module_search_paths, |
| 1633 | 'stdlib_dir': stdlibdir, |
| 1634 | } |
| 1635 | env = self.copy_paths_by_env(config) |
| 1636 | self.check_all_configs("test_init_compat_config", config, |
| 1637 | api=API_COMPAT, env=env, |
| 1638 | ignore_stderr=True, cwd=tmpdir) |
| 1639 | |
| 1640 | @unittest.skipUnless(MS_WINDOWS, 'See test_init_pybuilddir') |
| 1641 | def test_init_pybuilddir_win32(self): |
nothing calls this directly
no test coverage detected