summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-10-06 15:10:52 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-10-06 15:10:52 (GMT)
commit1d0d541259146f4ed33e3a606a74f227fd6d5fa3 (patch)
treee464baf253ac8863e2ce338fff7aa3469c5da87c /Lib
parent7d14015e629da702f17d5e0ab616c15c8145e771 (diff)
parent5061a342830b1a6165669eac950d67e38a0029a0 (diff)
downloadcpython-1d0d541259146f4ed33e3a606a74f227fd6d5fa3.zip
cpython-1d0d541259146f4ed33e3a606a74f227fd6d5fa3.tar.gz
cpython-1d0d541259146f4ed33e3a606a74f227fd6d5fa3.tar.bz2
Issue #16025: Minor corrections to the zipfile documentation.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_subprocess.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 6fc6108..5494feb 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -192,6 +192,28 @@ class ProcessTestCase(BaseTestCase):
p.wait()
self.assertEqual(p.stderr, None)
+ @unittest.skipIf(mswindows, "path not included in Windows message")
+ def test_path_in_arg_not_found_message(self):
+ # Check that the error message displays the path not found when
+ # args[0] is not found.
+ self.assertRaisesRegex(FileNotFoundError, "notfound_blahblah",
+ subprocess.Popen, ["notfound_blahblah"])
+
+ @unittest.skipIf(mswindows, "path not displayed in Windows message")
+ def test_path_in_executable_not_found_message(self):
+ # Check that the error message displays the executable argument (and
+ # not args[0]) when the executable argument is not found
+ # (issue #16114).
+ # We call sys.exit() inside the code to prevent the test runner
+ # from hanging if the test fails and finds python.
+ self.assertRaisesRegex(FileNotFoundError, "notfound_blahblah",
+ subprocess.Popen, [sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ executable="notfound_blahblah")
+ self.assertRaisesRegex(FileNotFoundError, "exenotfound_blahblah",
+ subprocess.Popen, ["argnotfound_blahblah"],
+ executable="exenotfound_blahblah")
+
# For use in the test_cwd* tests below.
def _normalize_cwd(self, cwd):
# Normalize an expected cwd (for Tru64 support).