aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorRémi Lapeyre <remi.lapeyre@lenstra.fr>2021-09-20 17:09:05 +0200
committerGitHub <noreply@github.com>2021-09-20 17:09:05 +0200
commit4d2957c1b9a915f76da418e89bf9b5add141ca3e (patch)
treec69d8a5b4c23e4800f877945f727a5786cb50717 /Lib/test/test_subprocess.py
parentef9e22b253253615098d22cb49141a2a1024ee3c (diff)
downloadcpython-4d2957c1b9a915f76da418e89bf9b5add141ca3e.tar.gz
cpython-4d2957c1b9a915f76da418e89bf9b5add141ca3e.zip
bpo-40497: Fix handling of check in subprocess.check_output() (GH-19897)
Co-authored-by: Tal Einat <taleinat@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 87967ca7f3c..3af523e8346 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -171,6 +171,14 @@ class ProcessTestCase(BaseTestCase):
[sys.executable, "-c", "print('BDFL')"])
self.assertIn(b'BDFL', output)
+ with self.assertRaisesRegex(ValueError,
+ "stdout argument not allowed, it will be overridden"):
+ subprocess.check_output([], stdout=None)
+
+ with self.assertRaisesRegex(ValueError,
+ "check argument not allowed, it will be overridden"):
+ subprocess.check_output([], check=False)
+
def test_check_output_nonzero(self):
# check_call() function with non-zero return code
with self.assertRaises(subprocess.CalledProcessError) as c: