diff --git a/testing_support/super_mox.py b/testing_support/super_mox.py index 433c675bf2..18d8219c11 100644 --- a/testing_support/super_mox.py +++ b/testing_support/super_mox.py @@ -98,7 +98,8 @@ class StdoutCheck(object): try: # If sys.stdout was used, self.checkstdout() must be called. # pylint: disable=E1101 - self.assertEquals('', sys.stdout.getvalue()) + if not sys.stdout.closed: + self.assertEquals('', sys.stdout.getvalue()) except AttributeError: pass sys.stdout = self._old_stdout diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 355cea917c..3b814f0e97 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -1592,7 +1592,6 @@ class CannedChecksUnittest(PresubmitTestsBase): self.assertEquals(results2[0].__class__, error_type) def ReadFileTest(self, check, content1, content2, error_type): - self.mox.StubOutWithMock(presubmit.InputApi, 'ReadFile') change1 = presubmit.Change( 'foo1', 'foo1\n', self.fake_root_dir, None, 0, 0, None) input_api1 = self.MockInputApi(change1, False)