Mock stdout to avoid pollutting test runner stdout.
[email protected]
BUG=
Review-Url: https://codereview.chromium.org/2055003003
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index 3561edc..b0048a1 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -1507,6 +1507,8 @@
self.assertEqual('hi\n\t there\n\nman', ChangelistMock.desc)
def test_archive(self):
+ self.mock(git_cl.sys, 'stdout', StringIO.StringIO())
+
self.calls = \
[((['git', 'for-each-ref', '--format=%(refname)', 'refs/heads'],),
'refs/heads/master\nrefs/heads/foo\nrefs/heads/bar'),
@@ -1541,6 +1543,7 @@
self.assertEqual(0, git_cl.main(['archive', '-f']))
def test_archive_current_branch_fails(self):
+ self.mock(git_cl.sys, 'stdout', StringIO.StringIO())
self.calls = \
[((['git', 'for-each-ref', '--format=%(refname)', 'refs/heads'],),
'refs/heads/master'),