Skip to content

Commit f6c29a6

Browse files
authored
bpo-34783: Disable test_nonexisting_script for macOS framework builds (pythonGH-9831)
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.
1 parent 17775ae commit f6c29a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_cmd_line_script.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,9 +630,13 @@ def test_consistent_sys_path_for_module_execution(self):
630630
traceback_lines = stderr.decode().splitlines()
631631
self.assertIn("No module named script_pkg", traceback_lines[-1])
632632

633+
@unittest.skipIf(sys.platform == 'darwin' and sys._framework,
634+
"test not valid for macOS framework builds")
633635
def test_nonexisting_script(self):
634636
# bpo-34783: "./python script.py" must not crash
635637
# if the script file doesn't exist.
638+
# (Skip test for macOS framework builds because sys.excutable name
639+
# is not the actual Python executable file name.
636640
script = 'nonexistingscript.py'
637641
self.assertFalse(os.path.exists(script))
638642
# Only test the base name, since the error message can use

0 commit comments

Comments
 (0)