MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_underpth_dll_file

Method test_underpth_dll_file

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

Source from the content-addressed store, hash-verified

792 @unittest.expectedFailure # TODO: RUSTPYTHON
793 @support.requires_subprocess()
794 def test_underpth_dll_file(self):
795 libpath = test.support.STDLIB_DIR
796 exe_prefix = os.path.dirname(sys.executable)
797 exe_file = self._create_underpth_exe(
798 self._get_pth_lines(libpath, import_site=True), exe_pth=False)
799 sys_prefix = os.path.dirname(exe_file)
800 env = os.environ.copy()
801 env['PYTHONPATH'] = 'from-env'
802 env['PATH'] = '{};{}'.format(exe_prefix, os.getenv('PATH'))
803 rc = subprocess.call([exe_file, '-c',
804 'import sys; sys.exit(not sys.flags.no_site and '
805 '%r in sys.path and %r in sys.path and %r not in sys.path and '
806 'all("\\r" not in p and "\\n" not in p for p in sys.path))' % (
807 os.path.join(sys_prefix, 'fake-path-name'),
808 libpath,
809 os.path.join(sys_prefix, 'from-env'),
810 )], env=env)
811 self.assertTrue(rc, "sys.path is incorrect")
812
813
814class CommandLineTests(unittest.TestCase):

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected