(self)
| 755 | |
| 756 | @support.requires_subprocess() |
| 757 | def test_underpth_file(self): |
| 758 | libpath = test.support.STDLIB_DIR |
| 759 | exe_prefix = os.path.dirname(sys.executable) |
| 760 | exe_file = self._create_underpth_exe( |
| 761 | self._get_pth_lines(libpath, import_site=True)) |
| 762 | sys_prefix = os.path.dirname(exe_file) |
| 763 | env = os.environ.copy() |
| 764 | env['PYTHONPATH'] = 'from-env' |
| 765 | env['PATH'] = '{};{}'.format(exe_prefix, os.getenv('PATH')) |
| 766 | rc = subprocess.call([exe_file, '-c', |
| 767 | 'import sys; sys.exit(not sys.flags.no_site and ' |
| 768 | '%r in sys.path and %r in sys.path and %r not in sys.path and ' |
| 769 | 'all("\\r" not in p and "\\n" not in p for p in sys.path))' % ( |
| 770 | os.path.join(sys_prefix, 'fake-path-name'), |
| 771 | libpath, |
| 772 | os.path.join(sys_prefix, 'from-env'), |
| 773 | )], env=env) |
| 774 | self.assertTrue(rc, "sys.path is incorrect") |
| 775 | |
| 776 | @support.requires_subprocess() |
| 777 | def test_underpth_dll_file(self): |
nothing calls this directly
no test coverage detected