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

Method test_underpth_file

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

Source from the content-addressed store, hash-verified

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

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