(self)
| 774 | self.assertIn("No module named script_pkg", traceback_lines[-1]) |
| 775 | |
| 776 | def test_nonexisting_script(self): |
| 777 | # bpo-34783: "./python script.py" must not crash |
| 778 | # if the script file doesn't exist. |
| 779 | # (Skip test for macOS framework builds because sys.executable name |
| 780 | # is not the actual Python executable file name. |
| 781 | script = 'nonexistingscript.py' |
| 782 | self.assertFalse(os.path.exists(script)) |
| 783 | |
| 784 | proc = spawn_python(script, text=True, |
| 785 | stdout=subprocess.PIPE, |
| 786 | stderr=subprocess.PIPE) |
| 787 | out, err = proc.communicate() |
| 788 | self.assertIn(": can't open file ", err) |
| 789 | self.assertNotEqual(proc.returncode, 0) |
| 790 | |
| 791 | @unittest.skipUnless(os.path.exists('/dev/fd/0'), 'requires /dev/fd platform') |
| 792 | @unittest.skipIf(sys.platform.startswith("freebsd") and |
nothing calls this directly
no test coverage detected