From: Victor Stinner Date: Tue, 31 May 2011 23:57:48 +0000 (+0200) Subject: Issue #12085: Fix test_subprocess for my previous commit X-Git-Tag: v2.7.3rc1~711^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e9b185f26318e7ff34bd8ec36a509cd85106d696;p=python Issue #12085: Fix test_subprocess for my previous commit Replace support by test_support, and add captured_stderr() function. --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 73c1b5c76b..a93602a7f8 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -116,7 +116,7 @@ class ProcessTestCase(BaseTestCase): def test_invalid_args(self): # Popen() called with invalid arguments should raise TypeError # but Popen.__del__ should not complain (issue #12085) - with support.captured_stderr() as s: + with test_support.captured_stderr() as s: self.assertRaises(TypeError, subprocess.Popen, invalid_arg_name=1) argcount = subprocess.Popen.__init__.__code__.co_argcount too_many_args = [0] * (argcount + 1) diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 81bb3ca017..de56e9e1b4 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -833,6 +833,9 @@ def captured_stdout(): """ return captured_output("stdout") +def captured_stderr(): + return captured_output("stderr") + def captured_stdin(): return captured_output("stdin")