]> granicus.if.org Git - python/commitdiff
Issue #12085: Fix test_subprocess for my previous commit
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 31 May 2011 23:57:48 +0000 (01:57 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 31 May 2011 23:57:48 +0000 (01:57 +0200)
Replace support by test_support, and add captured_stderr() function.

Lib/test/test_subprocess.py
Lib/test/test_support.py

index 73c1b5c76b470d421f183439019cb17937d41ae3..a93602a7f84fed828fd6bef4cc3459303762bd91 100644 (file)
@@ -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)
index 81bb3ca017d46e060873f72f9d525e484d924196..de56e9e1b4180764846127d191b70623c3bf2de6 100644 (file)
@@ -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")