[Python-checkins] bpo-34783: Disable test_nonexisting_script for macOS framework builds (GH-9831) (GH-9832)

Ned Deily webhook-mailer at python.org
Sat Oct 13 00:07:04 EDT 2018


https://github.com/python/cpython/commit/5d8ef8bc3f7307cd15f9d82ad4846e82b498ae88
commit: 5d8ef8bc3f7307cd15f9d82ad4846e82b498ae88
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Ned Deily <nad at python.org>
date: 2018-10-13T00:07:01-04:00
summary:

bpo-34783:  Disable test_nonexisting_script for macOS framework builds (GH-9831) (GH-9832)

With macOS framework builds, test case test_nonexisting_script in
test_nonexisting_script fails because the test case assumes that
the file name in sys.executable will appear in the error message.
For macOS framework builds, sys.executable is the file name of the
stub launcher and its file name bears no relationship to the file
name of the actual python executable.  For now, skip the test in
this case.
(cherry picked from commit f6c29a65e2a6da5c0014c868cf963c975b74e72b)

Co-authored-by: Ned Deily <nad at python.org>

files:
M Lib/test/test_cmd_line_script.py

diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index 2595ca98c7ad..4f5af3754418 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -630,9 +630,13 @@ def test_consistent_sys_path_for_module_execution(self):
             traceback_lines = stderr.decode().splitlines()
             self.assertIn("No module named script_pkg", traceback_lines[-1])
 
+    @unittest.skipIf(sys.platform == 'darwin' and sys._framework,
+                        "test not valid for macOS framework builds")
     def test_nonexisting_script(self):
         # bpo-34783: "./python script.py" must not crash
         # if the script file doesn't exist.
+        # (Skip test for macOS framework builds because sys.excutable name
+        #  is not the actual Python executable file name.
         script = 'nonexistingscript.py'
         self.assertFalse(os.path.exists(script))
         # Only test the base name, since the error message can use



More information about the Python-checkins mailing list