Commit 93e2137d authored by maruel@chromium.org's avatar maruel@chromium.org

Add more subprocess2 tests with stderr=subproces2.STDOUT.

No code change beside tests. This is mainly a regression test to make sure I
don't regress that code path.

TBR=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8695003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@111535 0039d316-1c4b-4281-b951-d872f2087c98
parent ef77f9e6
......@@ -255,6 +255,31 @@ class S2Test(unittest.TestCase):
self.assertEquals(0, code)
self._run_test(fn)
def test_check_output_redirect_stderr_to_stdout_pipe(self):
def fn(c, e, un):
(out, err), code = subprocess2.communicate(
e + ['--stderr'],
stdout=subprocess2.PIPE,
stderr=subprocess2.STDOUT,
universal_newlines=un)
# stderr output into stdout.
self.assertEquals(c('a\nbb\nccc\n'), out)
self.assertEquals(None, err)
self.assertEquals(0, code)
self._run_test(fn)
def test_check_output_redirect_stderr_to_stdout(self):
def fn(c, e, un):
(out, err), code = subprocess2.communicate(
e + ['--stderr'],
stderr=subprocess2.STDOUT,
universal_newlines=un)
# stderr output into stdout but stdout is not piped.
self.assertEquals(None, out)
self.assertEquals(None, err)
self.assertEquals(0, code)
self._run_test(fn)
def test_check_output_throw_stdout(self):
def fn(c, e, un):
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment