diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-09-11 15:54:07 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2018-09-11 15:54:07 (GMT) |
commit | 73870bfeb9cf350d84ee88bd25430c104b3c6191 (patch) | |
tree | 53529cb3a6e700e88a61a65f11d2db6f4d92e9df /Lib/test/test_subprocess.py | |
parent | 3102e24d83315eee42a94c460956fbcb92ac510f (diff) | |
download | cpython-73870bfeb9cf350d84ee88bd25430c104b3c6191.zip cpython-73870bfeb9cf350d84ee88bd25430c104b3c6191.tar.gz cpython-73870bfeb9cf350d84ee88bd25430c104b3c6191.tar.bz2 |
closes bpo-32490: Fix filename duplication in subprocess exception message. (GH-9163)
8621bb5d93239316f97281826461b85072ff6db7 sets the filename in directly in the FileNotFoundError, so we may revert the earlier fix 5f780400572508a8179de6a6c13b58b7be417ef5.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 8419061..c56e1b6 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1520,7 +1520,6 @@ class POSIXProcessTestCase(BaseTestCase): # string and instead capture the exception that we want to see # below for comparison. desired_exception = e - desired_exception.strerror += ': ' + repr(self._nonexistent_dir) else: self.fail("chdir to nonexistent directory %s succeeded." % self._nonexistent_dir) @@ -1537,6 +1536,7 @@ class POSIXProcessTestCase(BaseTestCase): # it up to the parent process as the correct exception. self.assertEqual(desired_exception.errno, e.errno) self.assertEqual(desired_exception.strerror, e.strerror) + self.assertEqual(desired_exception.filename, e.filename) else: self.fail("Expected OSError: %s" % desired_exception) @@ -1551,6 +1551,7 @@ class POSIXProcessTestCase(BaseTestCase): # it up to the parent process as the correct exception. self.assertEqual(desired_exception.errno, e.errno) self.assertEqual(desired_exception.strerror, e.strerror) + self.assertEqual(desired_exception.filename, e.filename) else: self.fail("Expected OSError: %s" % desired_exception) @@ -1564,6 +1565,7 @@ class POSIXProcessTestCase(BaseTestCase): # it up to the parent process as the correct exception. self.assertEqual(desired_exception.errno, e.errno) self.assertEqual(desired_exception.strerror, e.strerror) + self.assertEqual(desired_exception.filename, e.filename) else: self.fail("Expected OSError: %s" % desired_exception) |