mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
gh-57684: Update tests for PYTHONSAFEPATH=1 (#92358)
Fix tests failing with the PYTHONSAFEPATH=1 env var. Enhance also -P help in Python usage (python --help).
This commit is contained in:
parent
1303f8c927
commit
329afe78c3
8 changed files with 33 additions and 15 deletions
|
@ -116,7 +116,9 @@ class CmdLineTest(unittest.TestCase):
|
|||
self.assertIn(printed_file.encode('utf-8'), data)
|
||||
self.assertIn(printed_package.encode('utf-8'), data)
|
||||
self.assertIn(printed_argv0.encode('utf-8'), data)
|
||||
self.assertIn(printed_path0.encode('utf-8'), data)
|
||||
# PYTHONSAFEPATH=1 changes the default sys.path[0]
|
||||
if not sys.flags.safe_path:
|
||||
self.assertIn(printed_path0.encode('utf-8'), data)
|
||||
self.assertIn(printed_cwd.encode('utf-8'), data)
|
||||
|
||||
def _check_script(self, script_exec_args, expected_file,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue