(original) (raw)

changeset: 70558:07b43607a905 branch: 2.7 parent: 70556:26ea0a46aadd user: Victor Stinner victor.stinner@haypocalc.com date: Wed Jun 01 01:57:48 2011 +0200 files: Lib/test/test_subprocess.py Lib/test/test_support.py description: Issue #12085: Fix test_subprocess for my previous commit Replace support by test_support, and add captured_stderr() function. diff -r 26ea0a46aadd -r 07b43607a905 Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py Wed Jun 01 01:03:00 2011 +0200 +++ b/Lib/test/test_subprocess.py Wed Jun 01 01:57:48 2011 +0200 @@ -116,7 +116,7 @@ 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 -r 26ea0a46aadd -r 07b43607a905 Lib/test/test_support.py --- a/Lib/test/test_support.py Wed Jun 01 01:03:00 2011 +0200 +++ b/Lib/test/test_support.py Wed Jun 01 01:57:48 2011 +0200 @@ -833,6 +833,9 @@ """ return captured_output("stdout") +def captured_stderr(): + return captured_output("stderr") + def captured_stdin(): return captured_output("stdin") /victor.stinner@haypocalc.com