Пример #1
0
    def test_discard_stderr(self):
        """This method is not programatically testable,

        But will produce no expected output
        If it fails it becomes noticable at command line
        """
        # pylint: disable=no-self-use
        with swallow_stderr():
            print >> sys.stderr, 'hello'
Пример #2
0
 def test_swallow_stderr(self):
     stream = StringIO()
     with swallow_stderr(stream):
         print >> sys.stderr, 'hello'
     self.assertEqual(stream.getvalue(), 'hello\n')
Пример #3
0
 def test_no_args(self):
     with streams.swallow_stderr():
         self.assertRaises(SystemExit, re_render.parse_args, [])