diff options
author | Victor Stinner <vstinner@python.org> | 2022-05-06 01:41:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 01:41:24 (GMT) |
commit | 329afe78c3bbc234492a53f7a4084d07e215a077 (patch) | |
tree | 281fa4038479d8d6e92bfa1da96ce18aca56a8f5 /Lib/distutils | |
parent | 1303f8c927227b72d9ee9eae890be4692b4d4592 (diff) | |
download | cpython-329afe78c3bbc234492a53f7a4084d07e215a077.zip cpython-329afe78c3bbc234492a53f7a4084d07e215a077.tar.gz cpython-329afe78c3bbc234492a53f7a4084d07e215a077.tar.bz2 |
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).
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/tests/test_bdist_rpm.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_bdist_rpm.py b/Lib/distutils/tests/test_bdist_rpm.py index f1eb9ba..7eefa7b 100644 --- a/Lib/distutils/tests/test_bdist_rpm.py +++ b/Lib/distutils/tests/test_bdist_rpm.py @@ -49,6 +49,9 @@ class BuildRpmTestCase(support.TempdirManager, 'the rpm command is not found') @unittest.skipIf(find_executable('rpmbuild') is None, 'the rpmbuild command is not found') + # import foo fails with safe path + @unittest.skipIf(sys.flags.safe_path, + 'PYTHONSAFEPATH changes default sys.path') def test_quiet(self): # let's create a package tmp_dir = self.mkdtemp() @@ -93,6 +96,9 @@ class BuildRpmTestCase(support.TempdirManager, 'the rpm command is not found') @unittest.skipIf(find_executable('rpmbuild') is None, 'the rpmbuild command is not found') + # import foo fails with safe path + @unittest.skipIf(sys.flags.safe_path, + 'PYTHONSAFEPATH changes default sys.path') def test_no_optimize_flag(self): # let's create a package that breaks bdist_rpm tmp_dir = self.mkdtemp() |