Esempio n. 1
0
 def test__log(self):
     old_stderr = sys.stderr
     try:
         mock_stderr = io.StringIO()
         sys.stderr = mock_stderr
         # pylint: disable=protected-access,no-self-use
         support._log('Test Log Message')
         if sys.flags.verbose:
             expected = 'Test Log Message\n'
         else:
             expected = ""
         self.assertEqual(mock_stderr.getvalue(), expected)
     finally:
         sys.stderr = old_stderr
Esempio n. 2
0
 def test_log(self):
     old_stderr = sys.stderr
     try:
         mock_stderr = io.StringIO()
         sys.stderr = mock_stderr
         # pylint: disable=protected-access,no-self-use
         support._log('Test Log Message')
         if sys.flags.verbose:
             expected = 'Test Log Message\n'
         else:
             expected = ""
         self.assertEqual(mock_stderr.getvalue(), expected)
     finally:
         sys.stderr = old_stderr