MCPcopy Index your code
hub / github.com/python/cpython / test_underpth_dll_file

Method test_underpth_dll_file

Lib/test/test_site.py:777–794  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

775
776 @support.requires_subprocess()
777 def test_underpth_dll_file(self):
778 libpath = test.support.STDLIB_DIR
779 exe_prefix = os.path.dirname(sys.executable)
780 exe_file = self._create_underpth_exe(
781 self._get_pth_lines(libpath, import_site=True), exe_pth=False)
782 sys_prefix = os.path.dirname(exe_file)
783 env = os.environ.copy()
784 env['PYTHONPATH'] = 'from-env'
785 env['PATH'] = '{};{}'.format(exe_prefix, os.getenv('PATH'))
786 rc = subprocess.call([exe_file, '-c',
787 'import sys; sys.exit(not sys.flags.no_site and '
788 '%r in sys.path and %r in sys.path and %r not in sys.path and '
789 'all("\\r" not in p and "\\n" not in p for p in sys.path))' % (
790 os.path.join(sys_prefix, 'fake-path-name'),
791 libpath,
792 os.path.join(sys_prefix, 'from-env'),
793 )], env=env)
794 self.assertTrue(rc, "sys.path is incorrect")
795
796 @support.requires_subprocess()
797 def test_underpth_no_user_site(self):

Callers

nothing calls this directly

Calls 8

_create_underpth_exeMethod · 0.95
_get_pth_linesMethod · 0.95
assertTrueMethod · 0.80
dirnameMethod · 0.45
copyMethod · 0.45
formatMethod · 0.45
callMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected